diff --git a/entity/360Degree_entity/360Degree_entity.aod b/entity/360Degree_entity/360Degree_entity.aod index 3c9139943a40ae07963b30b9dcb582a6766c4700..7069d6c38e61b4bf3909502e67902cd1f7ecff6b 100644 --- a/entity/360Degree_entity/360Degree_entity.aod +++ b/entity/360Degree_entity/360Degree_entity.aod @@ -106,6 +106,7 @@ <name>newModule</name> <title>New module</title> <iconId>VAADIN:PLUS_CIRCLE</iconId> + <stateProcess>%aditoprj%/entity/360Degree_entity/entityfields/newmodule/stateProcess.js</stateProcess> <children> <entityActionField> <name>newOffer</name> @@ -168,6 +169,10 @@ <name>BaseContextId_param</name> <expose v="true" /> </entityParameter> + <entityParameter> + <name>ObjectStatus_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/360Degree_entity/entityfields/newmodule/stateProcess.js b/entity/360Degree_entity/entityfields/newmodule/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0b02ed053a7ba32d8f740031e0c5ceb72f1c3716 --- /dev/null +++ b/entity/360Degree_entity/entityfields/newmodule/stateProcess.js @@ -0,0 +1,9 @@ +import("system.vars"); +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); + +var objectStatusParam = vars.get("$param.ObjectStatus_param"); + +if (objectStatusParam == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index 4645d08bede5cf4032745659c003532e8998b2c4..8db94a88d290b6ae25d9b37180d3c350627e4344 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -4,6 +4,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/AnyContact_entity/documentation.adoc</documentation> <contentTitleProcess>%aditoprj%/entity/AnyContact_entity/contentTitleProcess.js</contentTitleProcess> + <afterUiInit>%aditoprj%/entity/AnyContact_entity/afterUiInit.js</afterUiInit> <imageProcess>%aditoprj%/entity/AnyContact_entity/imageProcess.js</imageProcess> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/AnyContact_entity/afterUiInit.js b/entity/AnyContact_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..ad4324c7682881b8e9ca470e334269ae822ec522 --- /dev/null +++ b/entity/AnyContact_entity/afterUiInit.js @@ -0,0 +1,23 @@ +import("system.neon"); +import("Keyword_lib"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index fde844bfab9f6ad4b50d0c00821b7052553ddde7..d4f33e27fc398d7d38bd931d71a7534b69374535 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -8,6 +8,7 @@ <grantUpdateProcess>%aditoprj%/entity/Contact_entity/grantUpdateProcess.js</grantUpdateProcess> <grantDeleteProcess>%aditoprj%/entity/Contact_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Contact_entity/contentTitleProcess.js</contentTitleProcess> + <afterUiInit>%aditoprj%/entity/Contact_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Contact_entity/onValidation.js</onValidation> <iconId>VAADIN:USERS</iconId> <titlePlural>Contacts</titlePlural> diff --git a/entity/Contact_entity/afterUiInit.js b/entity/Contact_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..ad4324c7682881b8e9ca470e334269ae822ec522 --- /dev/null +++ b/entity/Contact_entity/afterUiInit.js @@ -0,0 +1,23 @@ +import("system.neon"); +import("Keyword_lib"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 1e7a2a84ac30fd052f3d0433f8b85c6cef6f6a85..55f954b6501a729d5579a4b2e1f797422f88c8bc 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -548,6 +548,10 @@ <name>ObjectRowId_param</name> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/360degreeobjects/children/objectrowid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ObjectStatus_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityParameter> @@ -822,6 +826,7 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/openeditdefaultsview/onActionProcess.js</onActionProcess> <actionOrder v="1" /> <iconId>NEON:WRENCH</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newOffer</name> @@ -830,6 +835,7 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newoffer/onActionProcess.js</onActionProcess> <actionOrder v="2" /> <iconId>VAADIN:CART</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newoffer/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newActivity</name> @@ -853,12 +859,14 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newtask/onActionProcess.js</onActionProcess> <actionOrder v="3" /> <iconId>VAADIN:TASKS</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newtask/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newAppointment</name> <title>New appointment</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newappointment/stateProcess.js</stateProcess> <tooltip>New Appointment</tooltip> </entityActionField> <entityActionGroup> @@ -885,6 +893,7 @@ <isObjectAction v="false" /> <isSelectionAction v="true" /> <iconId>VAADIN:AT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/tooltipProcess.js</tooltipProcess> </entityActionField> <entityActionField> @@ -894,6 +903,7 @@ <isObjectAction v="false" /> <isSelectionAction v="true" /> <iconId>VAADIN:ENVELOPES</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess> </entityActionField> <entityActionField> @@ -913,6 +923,7 @@ <title>Add to Campaign</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/addtocampaign/onActionProcess.js</onActionProcess> <iconId>NEON:GROUP_APPOINTMENT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js</stateProcess> <tooltip>Choose a campaign and a step to add the contact to a campaign</tooltip> </entityActionField> <entityActionField> @@ -920,12 +931,14 @@ <title>Write email</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newemail/onActionProcess.js</onActionProcess> <iconId>VAADIN:AT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newemail/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newLetter</name> <title>New letter</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newletter/onActionProcess.js</onActionProcess> <iconId>VAADIN:ENVELOPE</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newletter/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>openAdminView</name> diff --git a/entity/Organisation_entity/afterUiInit.js b/entity/Organisation_entity/afterUiInit.js index 40048a413712450e39dc819e7142ed9b2a48d820..669f54dbb747c656a7723b9795e3e10875eade5c 100644 --- a/entity/Organisation_entity/afterUiInit.js +++ b/entity/Organisation_entity/afterUiInit.js @@ -1,8 +1,29 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); import("system.neon"); import("system.vars"); import("Context_lib"); import("Attribute_lib"); +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); diff --git a/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js b/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..047f2af7d720d3fb0c19529dc9d8dadae5342256 --- /dev/null +++ b/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.STATUS")); diff --git a/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js b/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1a24bf4924a99876b3bec1f9bec24fe7bed7743d --- /dev/null +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -0,0 +1,9 @@ +import("system.neon"); +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); +import("system.vars"); + + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js index 35dcb1420a14ba006cfc657b2ac1208bc2b46d2e..a4f62ede0a6fc0d8c841610e69fcace9a4213f30 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -1,3 +1,4 @@ +import("KeywordRegistry_basic"); import("system.db"); import("system.vars"); import("system.neon"); @@ -12,4 +13,7 @@ if(contactCount > 0) else { result.string(neon.COMPONENTSTATE_DISABLED); -} \ No newline at end of file +} + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..daa09139c5a6115f0f8dea868089b1293977fe97 --- /dev/null +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js @@ -0,0 +1,8 @@ +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); +import("system.vars"); + + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newappointment/stateProcess.js b/entity/Organisation_entity/entityfields/newappointment/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newappointment/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newemail/stateProcess.js b/entity/Organisation_entity/entityfields/newemail/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newemail/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newletter/stateProcess.js b/entity/Organisation_entity/entityfields/newletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newletter/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newoffer/stateProcess.js b/entity/Organisation_entity/entityfields/newoffer/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newoffer/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newtask/stateProcess.js b/entity/Organisation_entity/entityfields/newtask/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newtask/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js b/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/picture/displayValueProcess.js b/entity/Organisation_entity/entityfields/picture/displayValueProcess.js index 2ad6742677b7f0a685be75783483833b35bebfc0..fd846d87707177ddf7438dfb66f956da2bd57f76 100644 --- a/entity/Organisation_entity/entityfields/picture/displayValueProcess.js +++ b/entity/Organisation_entity/entityfields/picture/displayValueProcess.js @@ -1,10 +1,18 @@ import("system.vars"); import("system.result"); import("system.neon"); +import("KeywordRegistry_basic"); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) { - if (vars.get("$field.PICTURE")) - result.string(vars.get("$field.PICTURE")); + + if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string("VAADIN:CLOSE_BIG") else - result.string(vars.get("$param.AvatarText_param")); -} + { + if (vars.get("$field.PICTURE")) + result.string(vars.get("$field.PICTURE")); + else + result.string(vars.get("$param.AvatarText_param")); + } +} \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 7e9f0b8465ea8062679dd5f8ad432c77bb927e30..cf377afffe1287bb8bdec91c11392e40c12c3452 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -731,6 +731,10 @@ <name>ObjectRowId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/360degreeobjects/children/objectrowid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ObjectStatus_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityConsumer> @@ -960,12 +964,14 @@ <title>Edit defaults</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/openeditdefaultsview/onActionProcess.js</onActionProcess> <iconId>VAADIN:WRENCH</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newOffer</name> <title>New offer</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newoffer/onActionProcess.js</onActionProcess> <iconId>VAADIN:CART</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newoffer/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newActivity</name> @@ -980,6 +986,7 @@ <title>New task</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newtask/onActionProcess.js</onActionProcess> <iconId>VAADIN:TASKS</iconId> + <iconIdProcess>%aditoprj%/entity/Person_entity/entityfields/newtask/iconIdProcess.js</iconIdProcess> </entityActionField> <entityActionField> <name>addToCampaign</name> @@ -987,6 +994,7 @@ <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js</onActionProcess> <actionOrder v="1" /> <iconId>NEON:GROUP_APPOINTMENT</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/addtocampaign/stateProcess.js</stateProcess> <tooltip>Choose a campaign and a step to add the contact to a campaign</tooltip> </entityActionField> <entityActionGroup> @@ -1024,6 +1032,7 @@ <isObjectAction v="false" /> <isSelectionAction v="true" /> <iconId>VAADIN:ENVELOPES</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess> </entityActionField> <entityActionField> @@ -1089,12 +1098,14 @@ <title>Write email</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newemail/onActionProcess.js</onActionProcess> <iconId>VAADIN:AT</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newemail/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newAppointment</name> <title>New appointment</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newappointment/stateProcess.js</stateProcess> <tooltip>New Appointment</tooltip> </entityActionField> <entityActionField> @@ -1102,11 +1113,13 @@ <title>New letter</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newletter/onActionProcess.js</onActionProcess> <iconId>VAADIN:ENVELOPE</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newletter/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>openTaskView</name> <isMenuAction v="false" /> <isObjectAction v="false" /> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/opentaskview/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>startWorkflow</name> diff --git a/entity/Person_entity/afterUiInit.js b/entity/Person_entity/afterUiInit.js index 40048a413712450e39dc819e7142ed9b2a48d820..e756cf590afbc22dfff0537787df1a139a3d47ff 100644 --- a/entity/Person_entity/afterUiInit.js +++ b/entity/Person_entity/afterUiInit.js @@ -1,8 +1,29 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); import("system.neon"); import("system.vars"); import("Context_lib"); import("Attribute_lib"); +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); diff --git a/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js b/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c077bf5964a863059f2629603660d7d7eda02492 --- /dev/null +++ b/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.STATUS")); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js b/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js index f04c2eb6b26677e381d239f513a25ee02b5fff03..66a7a45263219f9c17b4775aaadf04a8fe344b3c 100644 --- a/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js +++ b/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js @@ -1,5 +1,5 @@ -import("system.vars"); -import("Campaign_lib"); - -var contactIdRay = [vars.getString("$field.CONTACTID")]; +import("system.vars"); +import("Campaign_lib"); + +var contactIdRay = [vars.getString("$field.CONTACTID")]; CampaignUtils.addParticipantsByRowIds(JSON.stringify(contactIdRay), "PERSON"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/addtocampaign/stateProcess.js b/entity/Person_entity/entityfields/addtocampaign/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/addtocampaign/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtobulkmailfromtable/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..97f11bcc36325116cb384cd7ffd6e3fc8b537061 --- /dev/null +++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var isInactive = vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive() ? true : false; + +if (isInactive) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..de48bf8c672f09224d17ea648e12c3c8c656ca70 --- /dev/null +++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -0,0 +1,14 @@ +import("system.db"); +import("system.vars"); +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); + + +var contactCount = vars.get("$sys.datarowcount") +var isInactive = vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive() ? true : false; + +if (contactCount <= 0 || isInactive) + result.string(neon.COMPONENTSTATE_DISABLED); +else + result.string(neon.COMPONENTSTATE_EDITABLE); diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/stateProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..97f11bcc36325116cb384cd7ffd6e3fc8b537061 --- /dev/null +++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/stateProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var isInactive = vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive() ? true : false; + +if (isInactive) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..92f584818ad1fcff6775adf3c9ef1acd2e807151 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.neon"); +import("system.result"); +import("system.result"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js index d7025bdf30d79dd2530c526aa2cdefe27514de17..1692669f6caf7db43e9f24decb3fcbfeb3c62993 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -1,3 +1,4 @@ +import("KeywordRegistry_basic"); import("system.db"); import("system.vars"); import("system.neon"); @@ -12,4 +13,7 @@ if(contactCount > 0) else { result.string(neon.COMPONENTSTATE_DISABLED); -} \ No newline at end of file +} + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0712af69970fdab78181f33195515067e0003949 --- /dev/null +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newappointment/stateProcess.js b/entity/Person_entity/entityfields/newappointment/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newappointment/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newemail/stateProcess.js b/entity/Person_entity/entityfields/newemail/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newemail/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newletter/stateProcess.js b/entity/Person_entity/entityfields/newletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newletter/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newoffer/stateProcess.js b/entity/Person_entity/entityfields/newoffer/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newoffer/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newtask/iconIdProcess.js b/entity/Person_entity/entityfields/newtask/iconIdProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Person_entity/entityfields/newtask/stateProcess.js b/entity/Person_entity/entityfields/newtask/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newtask/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js b/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/opentaskview/stateProcess.js b/entity/Person_entity/entityfields/opentaskview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Person_entity/entityfields/picture/displayValueProcess.js b/entity/Person_entity/entityfields/picture/displayValueProcess.js index 2ad6742677b7f0a685be75783483833b35bebfc0..fd846d87707177ddf7438dfb66f956da2bd57f76 100644 --- a/entity/Person_entity/entityfields/picture/displayValueProcess.js +++ b/entity/Person_entity/entityfields/picture/displayValueProcess.js @@ -1,10 +1,18 @@ import("system.vars"); import("system.result"); import("system.neon"); +import("KeywordRegistry_basic"); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) { - if (vars.get("$field.PICTURE")) - result.string(vars.get("$field.PICTURE")); + + if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string("VAADIN:CLOSE_BIG") else - result.string(vars.get("$param.AvatarText_param")); -} + { + if (vars.get("$field.PICTURE")) + result.string(vars.get("$field.PICTURE")); + else + result.string(vars.get("$param.AvatarText_param")); + } +} \ No newline at end of file diff --git a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod index 90abf63f4003d63aaad0590a57405845f10329a6..f8c447378a26d517bb9521f3913d82b9ac037d79 100644 --- a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod +++ b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod @@ -60,7 +60,7 @@ <columns> <neonTableColumn> <name>2008e7ac-9e6a-4104-9d5b-da60a10a1c02</name> - <entityField>#IMAGE</entityField> + <entityField>PICTURE</entityField> </neonTableColumn> <neonTableColumn> <name>a290a2ca-3236-4eb0-bf51-99f99d8414d6</name> diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index e8e257f78ff1f409e4ba075a1b1388877d0b6fae..b53349181660fe4f0829d5fa6f8b7e03e755f735 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -251,7 +251,6 @@ $KeywordRegistry.workflowSignalTrigger$delete = function(){return "TRIGGEREVENTD $KeywordRegistry.permissionCalendarType = function(){return "PermissionCalendarType";}; $KeywordRegistry.permissionCalendarType$user = function(){return "USER";}; $KeywordRegistry.permissionCalendarType$department = function(){return "DEPARTMENT";}; - $KeywordRegistry.workflowActivityType = function(){return "WorkflowActivityType";}; $KeywordRegistry.workflowActivityType$sequenceFlow = function(){return "sequenceFlow";}; $KeywordRegistry.workflowActivityType$startEvent = function(){return "startEvent";};