diff --git a/process/District_lib/process.js b/process/District_lib/process.js index 9dab569dadaf4a60ff3e35af9043596ee7531071..10344edf69541f54ef5e642a1df9d3bb77165d51 100644 --- a/process/District_lib/process.js +++ b/process/District_lib/process.js @@ -1,3 +1,4 @@ +import("system.tools"); import("system.text"); import("system.datetime"); import("system.notification"); @@ -423,18 +424,19 @@ DistrictUtils.assignOrganisationToDistrict = function (pOrganisationId, pUserLog * @return <none> <p> */ DistrictUtils.notificateNewDistrictContact = function(pDistrictContactId){ - logging.log(pDistrictContactId); message = translate.text("Assignment to a new district/company!"); //[0]: DISTRICT_ID, [1]: ADVISER_CONTACT_ID, [2]: CONTACT_ID var arrayDistrictContact = DistrictUtils.getDataFromDistrictContact(pDistrictContactId); - logging.log(arrayDistrictContact.length); + + //get corresponding profile information of the systemalias + var user = tools.getUserByAttribute(tools.CONTACTID, arrayDistrictContact[1], tools.PROFILE_DEFAULT); + var userName = user[tools.NAME]; + var districtName = DistrictUtils.getDistrictName(arrayDistrictContact[0]); - logging.log(districtName); var organisationName = ContactUtils.getFullTitleByContactId(arrayDistrictContact[2]); - logging.log(arrayDistrictContact + districtName + organisationName); // Benachrichtigung am Ende der Zuordnungen description = translate.withArguments("You were assigned as new district contact to district %0 and organisation %1.", [districtName, organisationName]) - notification.addNotification(util.getNewUUID(), text.encodeMS(["Organisation", arrayDistrictContact[2]]), null, null, "DistrictAssigned", notification.PRIO_NORMAL, 2, notification.STATE_UNSEEN, [user, arrayDistrictContact[1]], message, description); -} \ No newline at end of file + notification.addNotification(util.getNewUUID(), text.encodeMS(["Organisation", arrayDistrictContact[2]]), null, null, "DistrictAssigned", notification.PRIO_NORMAL, 2, notification.STATE_UNSEEN, [userName], message, description); +} diff --git a/process/process_audit/process.js b/process/process_audit/process.js index c4b318d0b301ccdd77f581dba5675aa58c2276f1..2a6f8cac186f152024ad1ea1daf967a4b3f50bd4 100644 --- a/process/process_audit/process.js +++ b/process/process_audit/process.js @@ -1,4 +1,3 @@ -import("system.logging"); import("District_lib"); import("Loghistory_lib"); import("system.vars"); @@ -25,6 +24,5 @@ if (sqlAction != 'X') //} if(sqlAction == 'I' && tableName == 'DISTRICTCONTACT'){ - logging.log("audit"); DistrictUtils.notificateNewDistrictContact(id); } \ No newline at end of file