Skip to content
Snippets Groups Projects
Commit 0d4514e1 authored by Andreas Schindlbeck's avatar Andreas Schindlbeck
Browse files

NotificationCenter: User kann Status ändern

parent 3d7e3938
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,38 @@
<entityField>
<name>LINKINFO</name>
</entityField>
<entityActionGroup>
<name>setNotificationState</name>
<children>
<entityActionField>
<name>setRead</name>
<fieldType>ACTION</fieldType>
<description></description>
<onActionProcess>%aditoprj%/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
<iconId>VAADIN:OPEN_BOOK</iconId>
<tooltip>gelesen setzen</tooltip>
</entityActionField>
<entityActionField>
<name>setUnread</name>
<fieldType>ACTION</fieldType>
<description></description>
<onActionProcess>%aditoprj%/entity/Notification_entity/entityfields/setnotificationstate/children/setunread/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
<iconId>VAADIN:BOOK</iconId>
<tooltip>ungelesen setzen</tooltip>
</entityActionField>
<entityActionField>
<name>archieve</name>
<fieldType>ACTION</fieldType>
<description></description>
<onActionProcess>%aditoprj%/entity/Notification_entity/entityfields/setnotificationstate/children/archieve/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
<iconId>VAADIN:ARCHIVE</iconId>
<tooltip>archivieren</tooltip>
</entityActionField>
</children>
</entityActionGroup>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.vars");
import("system.logging");
logging.log("caption: " + vars.get("$this.value"));
logging.log("typecode: " + vars.get("$field.TYPECODE"));
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.tools");
import("system.notification");
var user = tools.getCurrentUser();
var selectedNotifications = JSON.parse(vars.get("$sys.selection"));
logging.log("selectedNotifications: "+ typeof selectedNotifications + " " + selectedNotifications);
var userNotis = notification.getUserNotifications(user["name"], null);
logging.log("userNotis: " + userNotis);
var contentId;
for(var x = 0; x < selectedNotifications.length; x++)
{
for(var i = 0; i < userNotis.length; i++)
{
logging.log("PROPID: " + userNotis[i][notification.PROP_ID]);
logging.log("PROPID2: " + selectedNotifications[x]);
if(userNotis[i][notification.PROP_ID] == selectedNotifications[x])
{
logging.log("success");
contentId = userNotis[i][notification.PROP_CONTENTID];
notification.updateUserNotificationState(user["name"], contentId, notification.STATE_ARCHIVE);
break;
}
}
}
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.tools");
import("system.notification");
var user = tools.getCurrentUser();
var selectedNotifications = JSON.parse(vars.get("$sys.selection"));
logging.log("selectedNotifications: "+ typeof selectedNotifications + " " + selectedNotifications);
var userNotis = notification.getUserNotifications(user["name"], null);
logging.log("userNotis: " + userNotis);
var contentId;
for(var x = 0; x < selectedNotifications.length; x++)
{
for(var i = 0; i < userNotis.length; i++)
{
logging.log("PROPID: " + userNotis[i][notification.PROP_ID]);
logging.log("PROPID2: " + selectedNotifications[x]);
if(userNotis[i][notification.PROP_ID] == selectedNotifications[x])
{
logging.log("success");
contentId = userNotis[i][notification.PROP_CONTENTID];
notification.updateUserNotificationState(user["name"], contentId, notification.STATE_CONFIRMED);
break;
}
}
}
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.tools");
import("system.notification");
var user = tools.getCurrentUser();
var selectedNotifications = JSON.parse(vars.get("$sys.selection"));
logging.log("selectedNotifications: "+ typeof selectedNotifications + " " + selectedNotifications);
var userNotis = notification.getUserNotifications(user["name"], null);
logging.log("userNotis: " + userNotis);
var contentId;
for(var x = 0; x < selectedNotifications.length; x++)
{
for(var i = 0; i < userNotis.length; i++)
{
logging.log("PROPID: " + userNotis[i][notification.PROP_ID]);
logging.log("PROPID2: " + selectedNotifications[x]);
if(userNotis[i][notification.PROP_ID] == selectedNotifications[x])
{
logging.log("success");
contentId = userNotis[i][notification.PROP_CONTENTID];
notification.updateUserNotificationState(user["name"], contentId, notification.STATE_UNSEEN);
break;
}
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
<children>
<tableViewTemplate>
<name>Table</name>
<favoriteActionGroup1>setNotificationState</favoriteActionGroup1>
<showHeader v="true" />
<isSaveable v="false" />
<isEditable v="false" />
......
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