Skip to content
Snippets Groups Projects
Commit 177d60e1 authored by Dominik Lechner's avatar Dominik Lechner
Browse files

Fixes after review; Hardcoded Campaignstepid for chart

parent 5a00a906
No related branches found
No related tags found
No related merge requests found
Showing
with 372 additions and 300 deletions
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
<icon>VAADIN:GROUP</icon> <icon>VAADIN:GROUP</icon>
<node name="Group4" kind="123" title=""> <node name="Group4" kind="123" title="">
<node name="Campaign" kind="10077" /> <node name="Campaign" kind="10077" />
<node name="CampaignParticipant" kind="10077" />
<node name="INTERNAL_ADMINISTRATOR" kind="159" /> <node name="INTERNAL_ADMINISTRATOR" kind="159" />
</node> </node>
</node> </node>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
</entityField> </entityField>
<entityField> <entityField>
<name>LABEL</name> <name>LABEL</name>
<title>Count</title>
</entityField> </entityField>
<entityField> <entityField>
<name>COUNT</name> <name>COUNT</name>
......
...@@ -4,16 +4,14 @@ import("system.result"); ...@@ -4,16 +4,14 @@ import("system.result");
import("system.util"); import("system.util");
import("system.db"); import("system.db");
logging.log(" -> etz warad i im condition....");
var ret = []; var ret = [];
var campaignstepid = vars.get("$param.campaignStepId_param"); var campaignstepid = "86a6f7cc-5a1d-4e68-a05d-c99a355365df";//TODO: Refresh problem - vars.get("$param.campaignStepId_param");
var newParticipants = vars.get("$param.campaignParticipants_param"); var newParticipants = JSON.parse(vars.get("$param.campaignParticipants_param")).length;
var query = "select MAXPARTICIPANTS, count(CAMPAIGNPARTICIPANTID) from CAMPAIGNSTEP " var query = "select MAXPARTICIPANTS, count(CAMPAIGNPARTICIPANTID) from CAMPAIGNSTEP "
+ "join CAMPAIGNPARTICIPANT on CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID = CAMPAIGNSTEP.CAMPAIGNSTEPID " + "join CAMPAIGNPARTICIPANT on CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID = CAMPAIGNSTEP.CAMPAIGNSTEPID "
+ "where CAMPAIGNSTEP_ID = '" + campaignstepid + "'" + "where CAMPAIGNSTEP_ID = '" + campaignstepid + "' "
+ "group by CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID, MAXPARTICIPANTS"; + "group by CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID, MAXPARTICIPANTS";
var maxCurrentParticipants = db.table(query); var maxCurrentParticipants = db.table(query);
...@@ -21,9 +19,10 @@ var maxCurrentParticipants = db.table(query); ...@@ -21,9 +19,10 @@ var maxCurrentParticipants = db.table(query);
if(maxCurrentParticipants.length > 0) if(maxCurrentParticipants.length > 0)
{ {
logging.log("hallo2"); logging.log("hallo2");
ret[0] = [util.getNewUUID(), "Current Participants", maxCurrentParticipants[0][1], 0]; ret[0] = [util.getNewUUID(), "Current participants", maxCurrentParticipants[0][1], 0];
ret[1] = [util.getNewUUID(), "New Participants", newParticipants, 0]; ret[1] = [util.getNewUUID(), "New participants", newParticipants, 1];
ret[2] = [util.getNewUUID(), "Max Participants", Number(maxCurrentParticipants[0][0]) - (Number(maxCurrentParticipants[0][1] + Number(newParticipants))), 2]; logging.log(maxCurrentParticipants[0][0]);
ret[2] = [util.getNewUUID(), "Free participant slots", Number(maxCurrentParticipants[0][0]) - (Number(maxCurrentParticipants[0][1]) + Number(newParticipants)), 2];
} }
result.object(ret); result.object(ret);
\ No newline at end of file
...@@ -2,4 +2,4 @@ import("system.vars"); ...@@ -2,4 +2,4 @@ import("system.vars");
import("system.db"); import("system.db");
import("system.result"); import("system.result");
result.string(db.cell("select NAME from CAMPAIGNSTEP where CAMPAIGNSTEPID = '" + vars.get("$param.CampaignStepId_param") + "'")); result.string(db.cell("select NAME from CAMPAIGNSTEP where CAMPAIGNSTEPID = '" + vars.get("$field.CAMPAIGNSTEP_ID") + "'"));
\ No newline at end of file \ No newline at end of file
...@@ -22,8 +22,10 @@ ...@@ -22,8 +22,10 @@
<entityField> <entityField>
<name>EMPLOYEE_CONTACT_ID</name> <name>EMPLOYEE_CONTACT_ID</name>
<title>Zuständiger</title> <title>Zuständiger</title>
<consumer>PersonsConsumer</consumer> <consumer>Employees</consumer>
<mandatory v="true" /> <mandatory v="true" />
<valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/employee_contact_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/employee_contact_id/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>NAME</name> <name>NAME</name>
...@@ -136,15 +138,6 @@ ...@@ -136,15 +138,6 @@
<title>Max participants</title> <title>Max participants</title>
<mandatory v="true" /> <mandatory v="true" />
</entityField> </entityField>
<entityConsumer>
<name>PersonsConsumer</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Person_entity</entityName>
<fieldName>Contacts</fieldName>
</dependency>
</entityConsumer>
<entityConsumer> <entityConsumer>
<name>CampaignParticipantsConsumer</name> <name>CampaignParticipantsConsumer</name>
<title>Participants</title> <title>Participants</title>
...@@ -182,6 +175,15 @@ ...@@ -182,6 +175,15 @@
<title>Description</title> <title>Description</title>
<contentType>LONG_TEXT</contentType> <contentType>LONG_TEXT</contentType>
</entityField> </entityField>
<entityConsumer>
<name>Employees</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Employee_entity</entityName>
<fieldName>Employees</fieldName>
</dependency>
</entityConsumer>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
import("system.vars");
import("system.result");
import("Contact_lib");
result.string(ContactUtils.getTitleByContactId(vars.get("$field.EMPLOYEE_CONTACT_ID")));
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
import("Employee_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(EmployeeUtils.getCurrentContactId());
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</entityProvider> </entityProvider>
<entityField> <entityField>
<name>CAMPAIGNID</name> <name>CAMPAIGNID</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaignid/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaignid/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
...@@ -39,9 +40,11 @@ ...@@ -39,9 +40,11 @@
</entityField> </entityField>
<entityField> <entityField>
<name>EMPLOYEE_CONTACT_ID</name> <name>EMPLOYEE_CONTACT_ID</name>
<title>Hauptverantwortlicher</title> <title>Hauptverantw.</title>
<consumer>Employee</consumer>
<mandatory v="true" /> <mandatory v="true" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/employee_contact_id/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/employee_contact_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Campaign_entity/entityfields/employee_contact_id/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>DESCRIPTION</name> <name>DESCRIPTION</name>
...@@ -50,25 +53,29 @@ ...@@ -50,25 +53,29 @@
</entityField> </entityField>
<entityField> <entityField>
<name>USER_NEW</name> <name>USER_NEW</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/user_new/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/user_new/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>DATE_NEW</name> <name>DATE_NEW</name>
<contentType>DATE</contentType> <contentType>DATE</contentType>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/date_new/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/date_new/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>USER_EDIT</name> <name>USER_EDIT</name>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/user_edit/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/user_edit/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>DATE_EDIT</name> <name>DATE_EDIT</name>
<contentType>DATE</contentType> <contentType>DATE</contentType>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/date_edit/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/date_edit/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityConsumer> <entityConsumer>
<name>CampaignSteps</name> <name>CampaignSteps</name>
<title>Schritte</title> <title>Steps</title>
<fieldType>DEPENDENCY_OUT</fieldType> <fieldType>DEPENDENCY_OUT</fieldType>
<dependency> <dependency>
<name>dependency</name> <name>dependency</name>
...@@ -152,6 +159,15 @@ ...@@ -152,6 +159,15 @@
</entityParameter> </entityParameter>
</children> </children>
</entityConsumer> </entityConsumer>
<entityConsumer>
<name>Employee</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Employee_entity</entityName>
<fieldName>Employees</fieldName>
</dependency>
</entityConsumer>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
import("system.vars");
import("system.result");
import("Contact_lib");
result.string(ContactUtils.getTitleByContactId(vars.get("$field.EMPLOYEE_CONTACT_ID")));
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
import("Employee_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(EmployeeUtils.getCurrentContactId());
\ No newline at end of file
This diff is collapsed.
...@@ -2952,6 +2952,9 @@ ...@@ -2952,6 +2952,9 @@
<entry> <entry>
<key>This cannot be undone!</key> <key>This cannot be undone!</key>
</entry> </entry>
<entry>
<key>Campaign status</key>
</entry>
</keyValueMap> </keyValueMap>
<font name="Dialog" style="0" size="11" /> <font name="Dialog" style="0" size="11" />
<sqlModels> <sqlModels>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key>SalesprojectState</key> <key>SalesprojectState</key>
<value>Status</value> <value>Status</value>
</entry> </entry>
<entry>
<key>Steps</key>
<value>Stufen</value>
</entry>
<entry> <entry>
<key>Project management</key> <key>Project management</key>
<value>Projektmanagement</value> <value>Projektmanagement</value>
...@@ -150,6 +154,10 @@ ...@@ -150,6 +154,10 @@
<key>Austria</key> <key>Austria</key>
<value>Österreich</value> <value>Österreich</value>
</entry> </entry>
<entry>
<key>Set campaign step</key>
<value>Kampagnenstufe setzen</value>
</entry>
<entry> <entry>
<key>New time tracking</key> <key>New time tracking</key>
<value>Neuer Zeiteintrag</value> <value>Neuer Zeiteintrag</value>
...@@ -351,7 +359,7 @@ ...@@ -351,7 +359,7 @@
</entry> </entry>
<entry> <entry>
<key>Add participants to Campaign</key> <key>Add participants to Campaign</key>
<value>Teilnehmer/innen zu Kampagne hinzufügen</value> <value>Kampagnenteilnehmer/innen hinzufügen</value>
</entry> </entry>
<entry> <entry>
<key>Firstname</key> <key>Firstname</key>
...@@ -3154,6 +3162,10 @@ ...@@ -3154,6 +3162,10 @@
<entry> <entry>
<key>Tree Entity</key> <key>Tree Entity</key>
</entry> </entry>
<entry>
<key>Add participant to Campaign</key>
<value>Kampagnenteilnehmer/in hinzufügen</value>
</entry>
<entry> <entry>
<key>Relationtype</key> <key>Relationtype</key>
<value>Beziehungsart</value> <value>Beziehungsart</value>
......
...@@ -2983,6 +2983,9 @@ ...@@ -2983,6 +2983,9 @@
<entry> <entry>
<key>This cannot be undone!</key> <key>This cannot be undone!</key>
</entry> </entry>
<entry>
<key>Campaign status</key>
</entry>
</keyValueMap> </keyValueMap>
<font name="Dialog" style="0" size="11" /> <font name="Dialog" style="0" size="11" />
</language> </language>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>CampaignParticipantEdit_view</name> <name>CampaignParticipantEdit_view</name>
<title>Add participant to Campaign</title>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<layout> <layout>
<boxLayout> <boxLayout>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>CampaignParticipantFilter_view</name> <name>CampaignParticipantFilter_view</name>
<title>Kontakteasdasd</title> <title></title>
<description>asd</description> <description></description>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<layout> <layout>
<boxLayout> <boxLayout>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<subtitleField>STATE</subtitleField> <subtitleField>STATE</subtitleField>
<descriptionField>DESCRIPTION</descriptionField> <descriptionField>DESCRIPTION</descriptionField>
<entityField>#ENTITY</entityField> <entityField>#ENTITY</entityField>
<title></title>
</cardViewTemplate> </cardViewTemplate>
<genericViewTemplate> <genericViewTemplate>
<name>TimespanGeneric</name> <name>TimespanGeneric</name>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<preferences xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="3.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/preferences/3.1.0"> <preferences xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="3.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/preferences/3.1.0">
<name>_____PREFERENCES_PROJECT</name> <name>_____PREFERENCES_PROJECT</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<projectName>xRM-Basic_current</projectName> <projectName>xRM-Basic - neon - 2019</projectName>
<jditoMaxContentSize v="57671680" /> <jditoMaxContentSize v="57671680" />
<calendarCategoriesEvent> <calendarCategoriesEvent>
<entry> <entry>
......
...@@ -90,11 +90,10 @@ CampaignUtils.getCampaignStatusByCampaignId = function(pCampaignId) ...@@ -90,11 +90,10 @@ CampaignUtils.getCampaignStatusByCampaignId = function(pCampaignId)
CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId) CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId)
{ {
let colsCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnNames(); let colsCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnNames();
let colTypesCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnTypes();
let valsCampaignParticipantLog = new Array(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date")); let valsCampaignParticipantLog = new Array(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"));
let rows = db.insertData("CAMPAIGNPARTICIPANTLOG", colsCampaignParticipantLog, colTypesCampaignParticipantLog, valsCampaignParticipantLog); let rows = db.insertData("CAMPAIGNPARTICIPANTLOG", colsCampaignParticipantLog, null, valsCampaignParticipantLog);
return (rows == 1); return (rows == 1);
} }
......
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