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
Matevz Golob
erp5
Commits
5b0da624
Commit
5b0da624
authored
Jun 11, 2015
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
free subscription : some minor fixes + add interaction to generate reference
parent
5d873c30
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
191 additions
and
11 deletions
+191
-11
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/Base_unsubscribeFromEvent.xml
...kins/erp5_free_subscription/Base_unsubscribeFromEvent.xml
+1
-1
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/Entity_createFreeSubscription.xml
.../erp5_free_subscription/Entity_createFreeSubscription.xml
+1
-1
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/FreeSubscription_generateReference.xml
..._free_subscription/FreeSubscription_generateReference.xml
+17
-8
bt5/erp5_free_subscription/WorkflowTemplateItem/portal_workflow/free_subscription_interaction_workflow/interactions/free_subscription_reference.xml
...ion_workflow/interactions/free_subscription_reference.xml
+104
-0
bt5/erp5_free_subscription/WorkflowTemplateItem/portal_workflow/free_subscription_interaction_workflow/scripts/setReference.xml
...ubscription_interaction_workflow/scripts/setReference.xml
+67
-0
bt5/erp5_free_subscription/bt/version
bt5/erp5_free_subscription/bt/version
+1
-1
No files found.
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/Base_unsubscribeFromEvent.xml
View file @
5b0da624
...
...
@@ -73,7 +73,7 @@ if user is None:\n
event_id=request[\'id\'], \n
hmac=request["hash"])\n
\n
# serve the
im
age\n
# serve the
web-page that will display a "Sucessfully unsubscribe" mess
age\n
return context.index_html(request, request.RESPONSE, format=None)\n
</string>
</value>
</item>
...
...
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/Entity_createFreeSubscription.xml
View file @
5b0da624
...
...
@@ -56,7 +56,7 @@ free_subscription = context.getPortalObject().free_subscription_module.newConten
destination_value=context,\n
source=source,\n
resource=resource,\n
start
_date=start_date,\n
effective
_date=start_date,\n
title=title)\n
\n
free_subscription.validate()\n
...
...
bt5/erp5_free_subscription/SkinTemplateItem/portal_skins/erp5_free_subscription/FreeSubscription_generateReference.xml
View file @
5b0da624
...
...
@@ -51,14 +51,23 @@
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
group_reference = context.getSourceValue().getGroupReference()\n
counter = portal.portal_ids.generateNewId(\n
id_generator="uid",\n
id_group=\'.\'.join((\'free_subscription\', \'reference\', group_reference)),\n
default=1)\n
\n
source_reference = \'FS-%s-%05d\' % (group_reference, counter)\n
context.setReference(source_reference)\n
if context.getSource():\n
if context.getPortalType() == "Free Subscription":\n
generator_base = "free_subscription"\n
reference_base = "FS"\n
elif context.getPortalType() == "Free Subscription Request":\n
generator_base = "free_subscription_request"\n
reference_base = "FSR"\n
else:\n
raise ValueError("Should not be called for %s" %(context.getPortalType(),))\n
group_reference = context.getSourceValue().getGroupReference()\n
counter = portal.portal_ids.generateNewId(\n
id_generator="uid",\n
id_group=\'.\'.join((generator_base, \'reference\', group_reference)),\n
default=1)\n
\n
source_reference = \'%s-%s-%05d\' % (reference_base, group_reference, counter)\n
context.setReference(source_reference)\n
</string>
</value>
</item>
<item>
...
...
bt5/erp5_free_subscription/WorkflowTemplateItem/portal_workflow/free_subscription_interaction_workflow/interactions/free_subscription_reference.xml
0 → 100644
View file @
5b0da624
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionDefinition"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
activate_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<list>
<string>
setReference
</string>
</list>
</value>
</item>
<item>
<key>
<string>
before_commit_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
free_subscription_reference
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
submit
</string>
<string>
validate
</string>
</list>
</value>
</item>
<item>
<key>
<string>
once_per_transaction
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<list>
<string>
Free Subscription
</string>
<string>
Free Subscription Request
</string>
</list>
</value>
</item>
<item>
<key>
<string>
portal_type_group_filter
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_free_subscription/
SkinTemplateItem/portal_skins/erp5_free_subscription/NotificationMessage_getSubstitutionMappingDictFromEvent
.xml
→
bt5/erp5_free_subscription/
WorkflowTemplateItem/portal_workflow/free_subscription_interaction_workflow/scripts/setReference
.xml
View file @
5b0da624
...
...
@@ -50,62 +50,16 @@
</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>
<value>
<string>
state_change[\'object\'].FreeSubscription_generateReference()\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
event_valu
e, **kw
</string>
</value>
<value>
<string>
state_chang
e, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
NotificationMessage_getSubstitutionMappingDictFromEvent
</string>
</value>
<value>
<string>
setReference
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_free_subscription/bt/version
View file @
5b0da624
0.1.1
\ No newline at end of file
0.2
\ No newline at end of file
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