Skip to content
Snippets Groups Projects
Commit d632ebd8 authored by Markus Schloder's avatar Markus Schloder
Browse files

Merge branch '1066189_gb_2020.2.0_Betreuung_HamaDSG' into '2020.2.0_Betreuung_HamaDSG'

1066189 gb 2020.2.0 betreuung hama dsg

See merge request xrm/basic!472
parents 772ae952 71da0f5e
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@
<title>Company</title>
<consumer>Organisations</consumer>
<groupable v="true" />
<linkedContext>Person</linkedContext>
<linkedContext>Organisation</linkedContext>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/contact_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/contact_id/displayValueProcess.js</displayValueProcess>
......@@ -191,11 +191,38 @@
<name>RowId_param</name>
<expose v="true" />
</entityParameter>
<entityActionGroup>
<name>setStatus</name>
<children>
<entityActionField>
<name>setActive</name>
<title>Set active</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/setstatus/children/setactive/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
<iconId>VAADIN:THUMBS_UP</iconId>
<tooltip>Set status to active</tooltip>
</entityActionField>
<entityActionField>
<name>setInactive</name>
<title>Set inactive</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/setstatus/children/setinactive/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
<iconId>VAADIN:THUMBS_DOWN</iconId>
<tooltip>Set status to inactive</tooltip>
</entityActionField>
</children>
</entityActionGroup>
<entityParameter>
<name>isDashletView_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<isRequireContainerFiltering v="false" />
<hasDependentRecords v="true" />
<fromClauseProcess>%aditoprj%/entity/DistrictContact_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/DistrictContact_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
......
import("KeywordRegistry_basic");
import("system.vars");
import("system.neon");
import("District_lib");
var arrIds = vars.get("$sys.selection");
DistrictUtils.setDistrictContactStatus(arrIds, $KeywordRegistry.contactStatus$active());
neon.openHome();
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.vars");
import("system.neon");
import("District_lib");
var arrIds = vars.get("$sys.selection");
DistrictUtils.setDistrictContactStatus(arrIds, $KeywordRegistry.contactStatus$inactive());
neon.openHome();
import("KeywordRegistry_basic");
import("Employee_lib");
import("system.entities");
import("system.result");
import("system.vars");
import("Sql_lib");
var isDashletView = vars.get("$param.isDashletView_param");
var organisationID = vars.get("$param.currentOrganisationId_param");
var cond = newWhere();
......@@ -18,4 +21,15 @@ if (organisationID)
cond.and("DISTRICTCONTACT.CONTACT_ID", organisationID);
}
if(isDashletView)
{
var statusInReview = $KeywordRegistry.contactStatus$inReview();
var districtOrigin = $KeywordRegistry.districtOrigin$auto();
var currentContactId = EmployeeUtils.getCurrentContactId();
cond.and("DISTRICTCONTACT.STATUS", statusInReview);
cond.and("DISTRICTCONTACT.ORIGIN", districtOrigin);
cond.and("DISTRICTCONTACT.ADVISER_CONTACT_ID", currentContactId);
}
result.string(cond.toString());
\ No newline at end of file
......@@ -3,6 +3,27 @@
<name>DistrictContactFilter_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterable v="true" />
<dashletConfigurations>
<neonDashletConfiguration>
<name>OwnDistrictContactsToCheck</name>
<title>My district assignments to check</title>
<description>Show my district assignments with status review</description>
<fragment>DistrictContact/filter</fragment>
<icon>VAADIN:GLOBE</icon>
<categories>
<neonDashletCategory>
<name>district</name>
<title>District</title>
</neonDashletCategory>
</categories>
<parameters>
<neonDashletParameter>
<name>isDashletView_param</name>
<value>true</value>
</neonDashletParameter>
</parameters>
</neonDashletConfiguration>
</dashletConfigurations>
<layout>
<boxLayout>
<name>layout</name>
......@@ -11,6 +32,7 @@
<children>
<tableViewTemplate>
<name>districtContacts</name>
<favoriteActionGroup1>setStatus</favoriteActionGroup1>
<entityField>#ENTITY</entityField>
<linkedColumns />
<fixedFilterFields />
......
......@@ -60,13 +60,33 @@
</entry>
<entry>
<key>Assign all selected districts</key>
<value>Zuordnung für alle selektierten Gebiete</value>
<value>Zuordnung für alle selektierten Gebiete</value>
</entry>
<entry>
<key>Assignment for all selected districts will start now!</key>
<value>Zuordnung für alle selektierten Gebiete wird jetzt gestartet</value>
<value>Zuordnung für alle selektierten Gebiete wird jetzt gestartet</value>
</entry>
<entry>
<key>Assignment of all selected districts is completed!</key>
<value>Zuordnung für alle selektierten Gebiete abgeschlossen</value>
<value>Zuordnung für alle selektierten Gebiete abgeschlossen</value>
</entry>
<entry>
<key>Set active</key>
<value>Aktiv setzen</value>
</entry>
<entry>
<key>Set inactive</key>
<value>Inaktiv setzen</value>
</entry>
<entry>
<key>Set status to active</key
<value>Status auf aktiv setzen</value>
</entry>
<entry>
<key>Set status to inactive</key>
<value>Status auf inaktiv setzen</value>
</entry>
<entry>
<key>My district assignments to check</key>
<value>Meine zu prüfenden Gebietszuweisungen</value>
</entry>
\ No newline at end of file
......@@ -51,4 +51,19 @@
</entry>
<entry>
<key>Assignment of all selected districts is completed!</key>
</entry>
<entry>
<key>Set active</key>
</entry>
<entry>
<key>Set inactive</key>
</entry>
<entry>
<key>Set status to active</key>
</entry>
<entry>
<key>Set status to inactive</key>
</entry>
<entry>
<key>My district assignments to check</key>
</entry>
\ No newline at end of file
......@@ -230,20 +230,12 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
if (arrExistingIds.length > 0)
{
invalid = arrExistingIds.length;
for (var l=0; l<arrExistingIds.length; l++)
{
var valsUpdate = [
$KeywordRegistry.contactStatus$inReview(),
vars.get("$sys.user"),
vars.get("$sys.date")
];
var condition = newWhere("DISTRICTCONTACT.DISTRICTCONTACTID", arrExistingIds[l][0]);
updateArray.push(["DISTRICTCONTACT", colsUpdate, null, valsUpdate, condition.build()]);
}
db.updates(updateArray)
//die erste Spalte enthält die Ids der zu aktualisierenden Datensätze
var arrIds = arrExistingIds.map(function(value) { return value[0]; });
DistrictUtils.setDistrictContactStatus (arrIds, $KeywordRegistry.contactStatus$inReview());
}
return {
newAssigned : newAssigned,
invalid : invalid,
......@@ -364,6 +356,37 @@ DistrictUtils._getParentFilter = function (pParentDistrict_DistrictId, pPrevious
}
/**
* This function will set the status of districtcontact datasets
* @param {Array} pArrIds <p>
* IDs of districtcontact<br>
* @param {String} pStatus <p>
* Status, for example $KeywordRegistry.contactStatus$active<br>
* @return {none} <p>
*/
DistrictUtils.setDistrictContactStatus = function (pArrIds, pStatus)
{
var updateArray = [];
var colsUpdate = [
"STATUS",
"USER_EDIT",
"DATE_EDIT"
];
var valsUpdate = [
pStatus,
vars.get("$sys.user"),
vars.get("$sys.date")
];
for (var i=0; i<pArrIds.length; i++)
{
var condition = newWhere("DISTRICTCONTACT.DISTRICTCONTACTID", pArrIds[i]);
updateArray.push(["DISTRICTCONTACT", colsUpdate, null, valsUpdate, condition.build()]);
}
db.updates(updateArray);
}
/**
* This function will assign a new organisation to all districts, which
* - have the property "auto assignment"
......
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