Commit 0bfe0d03 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Extend requestEvent accept the sender

   Since the ticket could be seen by multiple users, don't force sender be the Ticket owner.
parent ff26d148
...@@ -97,6 +97,8 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -97,6 +97,8 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.assertRaises(TypeError, self.support_request.requestEvent) self.assertRaises(TypeError, self.support_request.requestEvent)
self.assertRaises(TypeError, self.support_request.requestEvent, event_title="A") self.assertRaises(TypeError, self.support_request.requestEvent, event_title="A")
self.assertRaises(TypeError, self.support_request.requestEvent, event_content="A") self.assertRaises(TypeError, self.support_request.requestEvent, event_content="A")
self.assertRaises(TypeError, self.support_request.requestEvent, event_source="A")
def test_SupportRequest_requestEvent(self): def test_SupportRequest_requestEvent(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue() person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
...@@ -109,8 +111,8 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -109,8 +111,8 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.support_request.requestEvent( self.support_request.requestEvent(
event_title="A", event_title="A",
event_content="B" event_content="B",
) event_source=person.getRelativeUrl())
self.tic() self.tic()
event_relative_url = self.support_request.REQUEST.get("event_relative_url") event_relative_url = self.support_request.REQUEST.get("event_relative_url")
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudTicketSlapInterfaceWorkflow</string> </value> <value> <string>testSlapOSCloudTicketSlapInterfaceWorkflow</string> </value>
...@@ -61,28 +55,13 @@ ...@@ -61,28 +55,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -95,7 +74,7 @@ ...@@ -95,7 +74,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -104,7 +83,7 @@ ...@@ -104,7 +83,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
...@@ -36,7 +36,8 @@ ticket.setStartDate(DateTime()) ...@@ -36,7 +36,8 @@ ticket.setStartDate(DateTime())
ticket.requestEvent( ticket.requestEvent(
event_title=ticket.getTitle(), event_title=ticket.getTitle(),
event_content=ticket.getDescription() event_content=ticket.getDescription(),
event_source=ticket.getDestinationDecision()
) )
event_relative_url = context.REQUEST.get("event_relative_url") event_relative_url = context.REQUEST.get("event_relative_url")
......
...@@ -9,14 +9,15 @@ kwargs = state_change.kwargs ...@@ -9,14 +9,15 @@ kwargs = state_change.kwargs
try: try:
title = kwargs['event_title'] title = kwargs['event_title']
text_content = kwargs['event_content'] text_content = kwargs['event_content']
source = kwargs['event_source']
except KeyError: except KeyError:
raise TypeError, "Ticket_requestEvent takes exactly 2 argument" raise TypeError, "Ticket_requestEvent takes at exactly 3 argument"
web_message = portal.event_module.newContent( web_message = portal.event_module.newContent(
portal_type="Web Message", portal_type="Web Message",
title=title, title=title,
text_content=text_content, text_content=text_content,
source=ticket.getDestinationDecision(), source=source,
content_type="text/plain", content_type="text/plain",
destination=ticket.getSource(), destination=ticket.getSource(),
resource=ticket.getResource(), resource=ticket.getResource(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment