Skip to content
Snippets Groups Projects
Commit 10a456af authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Martin Groppe
Browse files

Sales 1085045 advertising fixes

parent 81aa6d7b
No related branches found
No related tags found
No related merge requests found
Showing
with 103 additions and 18 deletions
== IsIntertAdvertising_param
Needed so we can use writeEntity in AdvertisingUtils.insertAdvertising() while still disabling creating records for the user
\ No newline at end of file
import("system.vars");
import("system.result");
import("Context_lib");
var res = [];
res.push({id: vars.get("$field.ADVERTISINGID"), tableNames: ["ADVERTISINGITEM"]});
res.push({id: vars.get("$field.ADVERTISINGID"), tableNames: ["ADVERTISING"]});
res = JSON.stringify(res);//currently only strings can be passed as param
result.object(res);
\ No newline at end of file
...@@ -3,9 +3,10 @@ import("system.vars"); ...@@ -3,9 +3,10 @@ import("system.vars");
import("system.result"); import("system.result");
import("Context_lib"); import("Context_lib");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.ROW_ID")) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.OBJECT_ROWID"))
{ {
result.string(""); result.string("");
} else if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE")) { }
result.string(ContextUtils.getTitleByContext(vars.get("$field.OBJECT_TYPE"), vars.get("$field.ROW_ID"))); else if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE")) {
result.string(ContextUtils.getTitleByContext(vars.get("$field.OBJECT_TYPE"), vars.get("$field.OBJECT_ROWID")));
} }
\ No newline at end of file
import("system.translate");
import("system.vars");
import("system.result");
import("Context_lib");
if (vars.exists("$field.OBJECT_TYPE") && vars.get("$field.OBJECT_TYPE"))
{
result.string(translate.text(vars.get("$field.OBJECT_TYPE")));
}
\ No newline at end of file
import("system.vars");
import("Context_lib");
AdminViewUtils.open("ADVERTISING", [
["DATE_NEW", vars.get("$field.DATE_NEW"), "DATE"],
["DATE_EDIT", vars.get("$field.DATE_EDIT"), "DATE"],
["USER_NEW", vars.get("$field.USER_NEW")],
["USER_EDIT", vars.get("$field.USER_EDIT")]
]);
\ No newline at end of file
import("Context_lib");
import("system.result");
result.string(AdminViewUtils.getActionState());
\ No newline at end of file
import("Sql_lib");
import("system.result"); import("system.result");
import("system.vars"); import("system.vars");
var contactIds = [];
//check if we have to restrict the working mode... if(vars.get("$param.ObjectType_param") == "Activity")
if(vars.exists("$param.ContactIds_param") && vars.get("$param.ContactIds_param")) {
contactIds = newSelect("ACTIVITYLINK.OBJECT_ROWID")
.from("ACTIVITYLINK")
.where("ACTIVITYLINK.OBJECT_TYPE", "Person")
.and("ACTIVITYLINK.ACTIVITY_ID", vars.get("$param.RowId_param"))
.arrayColumn();
}
//when not set yet, especially when directly in advertising there should be also only the linked person selectable
if(contactIds.length > 0)
{ {
result.string(vars.get("$param.ContactIds_param")); result.string(JSON.stringify(contactIds));
} }
\ No newline at end of file
import("system.util");
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
{
result.string(vars.get("$sys.user"));
}
\ No newline at end of file
import("system.util");
import("system.result");
import("system.neon"); import("system.neon");
import("system.vars"); import("system.vars");
import("system.result");
result.string(vars.get("$field.ADVERTISING") == "Y" ? neon.COMPONENTSTATE_EDITABLE : neon.COMPONENTSTATE_INVISIBLE); if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
\ No newline at end of file {
result.string(vars.get("$sys.user"));
}
\ No newline at end of file
...@@ -4,9 +4,6 @@ import("Sql_lib"); ...@@ -4,9 +4,6 @@ import("Sql_lib");
var cond = newWhere(); var cond = newWhere();
if(vars.exists("$param.RowId_param") && vars.get("$param.RowId_param")) cond.andIfSet("ADVERTISING.OBJECT_ROWID", vars.getString("$param.RowId_param"), SqlBuilder.EQUAL());
{
cond.andIfSet("advertising.ROW_ID", vars.getString("$param.RowId_param"), SqlBuilder.EQUAL());
}
result.string(cond.toString()); result.string(cond.toString());
\ No newline at end of file
import("system.result");
import("Person_lib");
result.string(PersUtils.getResolvingDisplaySubSql("CONTACT_ID"));
\ No newline at end of file
import("system.result");
import("Sql_lib");
result.string(new SqlBuilder().selectCount()
.from("ADVERTISINGITEM")
.where("ADVERTISINGITEM.ADVERTISING_ID = ADVERTISING.ADVERTISINGID").toString());
\ No newline at end of file
import("system.result");
import("Keyword_lib");
import("KeywordRegistry_basic");
var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.currency(), "ADVERTISING.CURRENCY");
result.string(sql);
\ No newline at end of file
import("system.result");
import("Person_lib");
result.string(PersUtils.getResolvingDisplaySubSql("RESPONSIBLE_ID"));
\ No newline at end of file
import("system.result");
import("Keyword_lib");
import("KeywordRegistry_basic");
var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.advertisingStatus(), "ADVERTISING.STATUS");
result.string(sql);
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
<entityField> <entityField>
<name>ADVERTISING</name> <name>ADVERTISING</name>
<title>Advertising material</title> <title>Advertising material</title>
<contentType>TEXT</contentType> <contentType>BOOLEAN</contentType>
<dropDownProcess>%aditoprj%/entity/Product_entity/entityfields/advertising/dropDownProcess.js</dropDownProcess>
<valueProcess>%aditoprj%/entity/Product_entity/entityfields/advertising/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Product_entity/entityfields/advertising/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
...@@ -538,7 +537,6 @@ ...@@ -538,7 +537,6 @@
<name>DIGITAL</name> <name>DIGITAL</name>
<title>Digital</title> <title>Digital</title>
<contentType>BOOLEAN</contentType> <contentType>BOOLEAN</contentType>
<stateProcess>%aditoprj%/entity/Product_entity/entityfields/digital/stateProcess.js</stateProcess>
</entityField> </entityField>
<entityParameter> <entityParameter>
<name>AdvertisingProducts_param</name> <name>AdvertisingProducts_param</name>
......
...@@ -2,5 +2,7 @@ import("system.vars"); ...@@ -2,5 +2,7 @@ import("system.vars");
import("system.result"); import("system.result");
import("system.neon"); import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
result.string("N"); {
\ No newline at end of file result.string("1");
}
\ No newline at end of file
...@@ -5,7 +5,7 @@ import("system.neon"); ...@@ -5,7 +5,7 @@ import("system.neon");
var ret = neon.COMPONENTSTATE_INVISIBLE; var ret = neon.COMPONENTSTATE_INVISIBLE;
if(Utils.toBoolean(vars.get("$field.ADVERTISING") == "Y" && vars.get("$field.DIGITAL"))) if(Utils.toBoolean(vars.get("$field.ADVERTISING")) && vars.get("$field.DIGITAL"))
{ {
ret = neon.COMPONENTSTATE_EDITABLE; ret = neon.COMPONENTSTATE_EDITABLE;
} }
......
...@@ -6,7 +6,7 @@ import("system.neon"); ...@@ -6,7 +6,7 @@ import("system.neon");
var ret = neon.COMPONENTSTATE_EDITABLE; var ret = neon.COMPONENTSTATE_EDITABLE;
//disabling the 'normal' Documentfolder when the product is a digital advertisingmaterial the second document component //disabling the 'normal' Documentfolder when the product is a digital advertisingmaterial the second document component
//will be enabled in reason there will be a keyword preselected so that digital Advertising Documents can be identified easier //will be enabled in reason there will be a keyword preselected so that digital Advertising Documents can be identified easier
if(Utils.toBoolean(vars.get("$field.ADVERTISING") == "Y" && vars.get("$field.DIGITAL"))) if(Utils.toBoolean(vars.get("$field.ADVERTISING")) && vars.get("$field.DIGITAL"))
{ {
ret = neon.COMPONENTSTATE_INVISIBLE; ret = neon.COMPONENTSTATE_INVISIBLE;
} }
......
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