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