Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
79f649fe
Commit
79f649fe
authored
Feb 01, 2016
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm : merge scripts NotificationMessage_getSubstitutionMappingDictFromEvent into one only
parent
fb47b9ce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
123 deletions
+50
-123
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/NotificationMessage_getSubstitutionMappingDictFromEvent.xml
...tificationMessage_getSubstitutionMappingDictFromEvent.xml
+50
-10
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/NotificationMessage_getSubstitutionMappingDictFromEvent.xml
...tificationMessage_getSubstitutionMappingDictFromEvent.xml
+0
-113
No files found.
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/NotificationMessage_getSubstitutionMappingDictFromEvent.xml
View file @
79f649fe
...
@@ -56,16 +56,56 @@ portal = context.getPortalObject()\n
...
@@ -56,16 +56,56 @@ portal = context.getPortalObject()\n
hmac = portal.Base_getHMACHexdigest(key=portal.Base_getEventHMACKey(), message=event_value.getId())\n
hmac = portal.Base_getHMACHexdigest(key=portal.Base_getEventHMACKey(), message=event_value.getId())\n
\n
\n
def getSubstitutionMappingDict():\n
def getSubstitutionMappingDict():\n
kw.update(\n
destination = event_value.getDestinationValue()\n
destination_title=event_value.getDestinationTitle() or \'\',\n
kw[\'event_value_source_title\'] = event_value.getSourceTitle()\n
destination_portal_type=event_value.getDestination() and event_value.getDestinationValue().getTranslatedPortalType(),\n
\n
destination_social_title=event_value.getDestination() and event_value.getDestinationValue().getProperty(\'social_title_translated_title\') or \'\',\n
if destination is not None:\n
destination_reference=event_value.getDestination() and event_value.getDestinationValue().getReference() or \'\',\n
kw[\'third_party_reference\'] = destination.getDestinationReference()\n
source_title=event_value.getSourceTitle() or \'\',\n
kw[\'address\'] = (destination.getDefaultAddressText() or \'\').upper()\n
image_parameters = "/Base_openEvent?id=%s&hash=%s" %(event_value.getId(), hmac),\n
kw[\'email\'] = destination.getDefaultEmailText() or \'\'\n
document_parameters = "/Base_readEvent?id=%s&hash=%s" %(event_value.getId(), hmac),\n
kw[\'telephone\'] = destination.getDefaultTelephoneText() or \'\'\n
unsubscribe_parameters = "/Base_unsubscribeFromEvent?id=%s&hash=%s" %(event_value.getId(), hmac),\n
kw[\'mobile\'] = destination.getMobileTelephoneText() or \'\'\n
)\n
kw[\'creation_date\'] = destination.getCreationDate()\n
kw[\'origin_campaign\'] = destination.getOriginReference()\n
\n
if destination.getPortalType() == \'Person\':\n
kw[\'first_name\'] = destination.getFirstName()\n
kw[\'last_name\'] = destination.getLastName()\n
kw[\'social_title\'] = destination.getSocialTitleTranslatedTitle("")\n
kw[\'third_party_name\'] = destination.getTitle()\n
if destination.getSocialTitle():\n
kw[\'third_party_name\'] = "%s %s" % (destination.getSocialTitleTranslatedTitle() or \'\',\n
destination.getTitle())\n
elif destination.getPortalType() == \'Organisation\':\n
kw[\'social_title\'] = str(translateString("Participant"))\n
kw[\'third_party_name\'] = destination.getCorporateName() or destination.getTitle()\n
\n
\n
# Backward compatibility\n
kw["destination_title"] = destination.getTitle()\n
kw["destination_portal_type"] = destination.getTranslatedPortalType()\n
kw["destination_social_title"] = destination.getProperty(\'social_title_translated_title\')\n
kw["destination_reference"] = destination.getReference()\n
else:\n
kw["destination_title"] = ""\n
kw["destination_portal_type"] = ""\n
kw["destination_social_title"] = ""\n
kw["destination_reference"] = ""\n
\n
kw[\'event_value_start_date\'] = event_value.getStartDate()\n
kw[\'event_value_nature\'] = event_value.getResourceReference()\n
kw[\'event_value_reference\'] = event_value.getReference()\n
kw[\'ticket_reference\'] = event_value.getDefaultFollowUpReference()\n
hmac = portal.Base_getHMACHexdigest(key=portal.Base_getEventHMACKey(), message=event_value.getId())\n
kw["image_parameters"] = "/Base_openEvent?id=%s&hash=%s" %(event_value.getId(), hmac)\n
kw["newsletter_parameters"] = "/Base_readEvent?id=%s&hash=%s" %(event_value.getId(), hmac)\n
kw["unsubscribe_parameters"] = "/Base_unsubscribe?id=%s&hash=%s" %(event_value.getId(), hmac)\n
\n
# Backward compatibility\n
kw["source_title"] = event_value.getSourceTitle() or \'\',\n
kw["document_parameters"] = "/Base_readEvent?id=%s&hash=%s" %(event_value.getId(), hmac),\n
\n
\n
return kw\n
return kw\n
\n
\n
if context.hasLanguage():\n
if context.hasLanguage():\n
...
...
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/NotificationMessage_getSubstitutionMappingDictFromEvent.xml
deleted
100644 → 0
View file @
fb47b9ce
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
from Products.ERP5Type.Message import translateString\n
portal = context.getPortalObject()\n
format_address = portal.ERP5Site_formatFrenchAddressText\n
\n
def getSubstitutionMappingDict():\n
destination = event_value.getDestinationValue()\n
kw[\'event_value_source_title\'] = event_value.getSourceTitle()\n
\n
if destination is not None:\n
kw[\'third_party_reference\'] = destination.getDestinationReference()\n
kw[\'address\'] = (destination.getDefaultAddressText() or \'\').upper()\n
kw[\'email\'] = destination.getDefaultEmailText() or \'\'\n
kw[\'telephone\'] = destination.getDefaultTelephoneText() or \'\'\n
kw[\'mobile\'] = destination.getMobileTelephoneText() or \'\'\n
kw[\'creation_date\'] = destination.getCreationDate()\n
kw[\'origin_campaign\'] = destination.getOriginReference()\n
\n
if destination.getPortalType() == \'Person\':\n
kw[\'first_name\'] = destination.getFirstName()\n
kw[\'last_name\'] = destination.getLastName()\n
kw[\'social_title\'] = destination.getSocialTitleTranslatedTitle("")\n
kw[\'third_party_name\'] = destination.getTitle()\n
if destination.getSocialTitle():\n
kw[\'third_party_name\'] = "%s %s" % (destination.getSocialTitleTranslatedTitle() or \'\',\n
destination.getTitle())\n
elif destination.getPortalType() == \'Organisation\':\n
kw[\'social_title\'] = str(translateString("Participant"))\n
kw[\'third_party_name\'] = destination.getCorporateName() or destination.getTitle()\n
\n
kw[\'event_value_start_date\'] = event_value.getStartDate()\n
kw[\'event_value_nature\'] = event_value.getResourceReference()\n
kw[\'event_value_reference\'] = event_value.getReference()\n
kw[\'ticket_reference\'] = event_value.getDefaultFollowUpReference()\n
hmac = portal.Base_getHMACHexdigest(key=portal.Base_getEventHMACKey(), message=event_value.getId())\n
kw["image_parameters"] = "/Base_openEvent?id=%s&hash=%s" %(event_value.getId(), hmac)\n
kw["newsletter_parameters"] = "/Base_readEvent?id=%s&hash=%s" %(event_value.getId(), hmac)\n
kw["unsubscribe_parameters"] = "/Base_unsubscribe?id=%s&hash=%s" %(event_value.getId(), hmac)\n
\n
return kw\n
\n
\n
with context.getPortalObject().Localizer.translationContext("fr"):\n
return getSubstitutionMappingDict()\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
event_value, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
NotificationMessage_getSubstitutionMappingDictFromEvent
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment