Commit afab3809 authored by Nicolas Delaby's avatar Nicolas Delaby

2008-09-02 nicolas

* add new transition to display Re Assign in workflow action
* Bug Notification can be send later to change recipient list
* Add File dialog require missing mandatory fields
* New worklist on bug_evnt_worklow to display planned Bug Line

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23350 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent caf23bb5
......@@ -73,49 +73,49 @@ translateString = context.Base_translateString\n
\n
default_bug_line = getattr(context, "default_bug_line", None)\n
if default_bug_line is None and context.getPortalType() == \'Bug\':\n
default_bug_line = context.newContent(id="default_bug_line", \n
portal_type="Bug Line",\n
title="Default Bug Line")\n
else:\n
default_bug_line = context.newContent(id="default_bug_line",\n
portal_type="Bug Line",\n
title="Default Bug Line")\n
elif default_bug_line is None:\n
default_bug_line = context\n
\n
# Create a new File or Image Document\n
document = default_bug_line.newContent(portal_type=portal_type, \n
description=description, \n
title=title,\n
file=file)\n
document = default_bug_line.newContent(portal_type=portal_type,\n
description=description,\n
title=title,\n
file=file,\n
reference=kw.get(\'reference\'),\n
version=kw.get(\'version\'),\n
language=kw.get(\'language\'))\n
\n
if context.getPortalType() == \'Bug\':\n
bug = context\n
else:\n
bug = context.getParentValue()\n
body = """\n
New %s was added. \n
New %s was added.\n
Title: %s\n
Description: %s\n
Link: %s/view\n
\n
\n
Bug Title: %s\n
Bug Link: %s/view\n
""" % (document.getPortalType(),\n
document.getTitle(), document.getDescription(), \n
document.getAbsoluteUrl(), bug.getTitle(), \n
document.getTitle(), document.getDescription(),\n
document.getAbsoluteUrl(), bug.getTitle(),\n
bug.getAbsoluteUrl())\n
\n
# Define Recipents\n
project = bug.getDestinationProjectValue()\n
if project is not None:\n
recipient_list = [ i.getParent() for i in project.getDestinationProjectRelatedValueList(portal_type="Assignment")]\n
\n
recipient_list= bug.Bug_getRecipientValueList()\n
sender = bug.Bug_getNotificationSenderValue()\n
\n
portal = bug.getPortalObject()\n
portal.portal_notifications.sendMessage(sender=sender,\n
recipient=recipient_list, \n
subject="[ERP5 Bug] [New File] %s" % (bug.getTitle()), \n
recipient=recipient_list,\n
subject="[ERP5 Bug] [New File] %s" % (bug.getTitle()),\n
message=body)\n
\n
# Redirect to even\n
portal_status_message = translateString("New ${portal_type} Added.", \n
portal_status_message = translateString("New ${portal_type} Added.",\n
mapping = dict(portal_type = translateString(portal_type)))\n
return document.Base_redirect(\'view\', keep_items = dict(portal_status_message=portal_status_message), **kw)\n
</string> </value>
......@@ -132,6 +132,12 @@ return document.Base_redirect(\'view\', keep_items = dict(portal_status_message=
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>portal_type, title, description, file, form_id=\'view\', **kw</string> </value>
......@@ -175,11 +181,6 @@ return document.Base_redirect(\'view\', keep_items = dict(portal_status_message=
<string>document</string>
<string>bug</string>
<string>body</string>
<string>project</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>i</string>
<string>recipient_list</string>
<string>sender</string>
<string>portal</string>
......
......@@ -42,6 +42,12 @@
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Bug_newFile</string> </value>
......@@ -104,7 +110,10 @@
<list>
<string>your_portal_type</string>
<string>your_title</string>
<string>your_reference</string>
<string>your_language</string>
<string>your_file</string>
<string>your_version</string>
</list>
</value>
</item>
......@@ -129,7 +138,7 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Ticket_viewNewFileDialog</string> </value>
<value> <string>Bug_viewNewFileDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
......
......@@ -105,7 +105,7 @@ body += """ Messages :\n
simulation_state = (\'delivered\', \'started\')\n
bug_message_list = [bug_message]\n
lines_list = bug.searchFolder(portal_type=\'Bug Line\', sort_on=(("id", "DESC"),),\n
simulation_state=simulation_state) \n
simulation_state=simulation_state)\n
bug_message_list.extend(lines_list)\n
message_count = len(bug_message_list)+1\n
for message in bug_message_list:\n
......@@ -116,10 +116,12 @@ for message in bug_message_list:\n
""" % (message_count, bug_message.getSourceTitle(\'\'), \n
message.getStartDate(), message.getTextContent(\'\') )\n
\n
recipient_list = bug_message.BugLine_getRecipientValueList()\n
\n
portal = bug_message.getPortalObject()\n
portal.portal_notifications.sendMessage(sender=bug_message.getSourceValue(),\n
recipient=bug_message.getDestinationValueList(), \n
subject="[Bug %s] %s" % (bug.getReference(), bug.getTitle()), \n
recipient=recipient_list,\n
subject="[Bug %s] %s" % (bug.getReference(), bug.getTitle()),\n
message=body)\n
</string> </value>
</item>
......@@ -178,6 +180,7 @@ portal.portal_notifications.sendMessage(sender=bug_message.getSourceValue(),\n
<string>message_count</string>
<string>_getiter_</string>
<string>message</string>
<string>recipient_list</string>
<string>portal</string>
</tuple>
</value>
......
......@@ -31,7 +31,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Posted</string> </value>
<value> <string>Send</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
......
......@@ -21,6 +21,12 @@
<dictionary/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>worklists</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="WorklistDefinition" module="Products.DCWorkflow.Worklists"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Bug Lines to Send (%(count)s)</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[
/WebSite_viewAdvancedSearchResultList?portal_type=%(portal_type)s&simulation_state=planned&local_roles=%(local_roles)s&reset:int=1
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Bug Lines to Send.</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>01_planned_bug_line_list</string> </value>
</item>
<item>
<key> <string>var_matches</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Owner</string>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>portal_type</string> </key>
<value>
<tuple>
<string>Bug Line</string>
</tuple>
</value>
</item>
<item>
<key> <string>simulation_state</string> </key>
<value>
<tuple>
<string>planned</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,8 +68,15 @@
<value> <string encoding="cdata"><![CDATA[
bug = state_change["object"]\n
valid_transaction_list = ["confirm_action", "stop_action", \n
"deliver_action", "set_ready_action" , "cancel_action"]\n
history = bug.portal_workflow.getInfoFor(bug, \'history\',\n
wf_id=\'bug_workflow\')\n
for history_item in history[::-1]:\n
if history_item[\'action\'].endswith(\'action\'):\n
send_event = history_item[\'send_event\']\n
break\n
\n
valid_transaction_list = ["confirm_action", "stop_action",\n
"deliver_action", "set_ready_action", "cancel_action"]\n
\n
message = [ h for h in state_change.getHistory() \\\n
if h[\'action\'] in valid_transaction_list]\n
......@@ -78,13 +85,14 @@ comment = ""\n
if len(message) > 0:\n
comment=message[-1]["comment"]\n
\n
line = bug.newContent(title="Bug %s was %s" % (bug.getReference(),\n
bug.getSimulationStateTitle()),\n
portal_type="Bug Line",\n
text_content=comment)\n
\n
# This will post The message Automatically.\n
line.start()\n
line = bug.newContent(title="Bug %s was %s" % (bug.getReference(), bug.getSimulationStateTitle()),\n
portal_type="Bug Line",\n
text_content=comment)\n
if send_event:\n
# This will post The message Automatically.\n
line.start()\n
else:\n
line.plan()\n
]]></string> </value>
......@@ -138,11 +146,14 @@ line.start()\n
<string>state_change</string>
<string>_getitem_</string>
<string>bug</string>
<string>_getattr_</string>
<string>history</string>
<string>_getiter_</string>
<string>history_item</string>
<string>send_event</string>
<string>valid_transaction_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>h</string>
<string>message</string>
<string>comment</string>
......
2008-09-02 nicolas
* add new transition to display Re Assign in workflow action
* Bug Notification can be send later to change recipient list
* Add File dialog require missing mandatory fields
* New worklist on bug_evnt_worklow to display planned Bug Line
2008-08-29 yusei
* Improve domain tree mode of glossary term list.
......
335
\ No newline at end of file
336
\ No newline at end of file
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