[Erp5-report] r16375 - in /erp5/trunk/bt5/erp5_crm: SkinTemplateItem/portal_skins/erp5_crm/...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 14 15:49:02 CEST 2007


Author: jp
Date: Fri Sep 14 15:49:02 2007
New Revision: 16375

URL: http://svn.erp5.org?rev=16375&view=rev
Log:
Added single event aggregation feature. made it possible to delete planned events.

Added:
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_single_event.xml
Modified:
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_newEvent.xml
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog.xml
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_description.xml
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_text_content.xml
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_title.xml
    erp5/trunk/bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/states/planned.xml

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_newEvent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_newEvent.xml?rev=16375&r1=16374&r2=16375&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_newEvent.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_newEvent.xml Fri Sep 14 15:49:02 2007
@@ -65,7 +65,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
+            <value> <string encoding="cdata"><![CDATA[
+
+"""\n
   This script creates a new event with given metadata and\n
   attaches it to the current ticket.\n
 """\n
@@ -82,31 +84,49 @@
 user_person = context.portal_catalog.getResultValue(portal_type=\'Person\', reference=user)\n
 \n
 # For every person, create an event\n
-count = 0\n
-for person in person_list:\n
-  # Create a new event\n
+if not single_event:\n
+  count = 0\n
+  for person in person_list:\n
+    # Create a new event\n
+    event = module.newContent(portal_type=portal_type, \n
+                            description=description, \n
+                            title=title, \n
+                            follow_up=follow_up,\n
+                            text_content=text_content) # text_format is set by Event_init\n
+    count += 1\n
+    # Trigger appropriate workflow action\n
+    if direction == \'incoming\':\n
+      event.setSourceValue(person)\n
+      event.setDestinationValue(user_person)\n
+      event.receive()\n
+    else:\n
+      event.plan()\n
+      event.setDestinationValue(person)\n
+      event.setSourceValue(user_person)\n
+else:\n
+  if direction == \'incoming\' and len(person_list) > 1:\n
+    # This case is not possible\n
+    portal_status_message = translateString("The Single Event option can only be used with outgoing messages",\n
+                                    mapping = dict(portal_type = portal_type, count=count))\n
+    return context.Base_redirect(form_id, keep_items = dict(portal_status_message=portal_status_message, selection_name=selection_name, selection_index=selection_index), **kw)\n
+  # Proceed to event creation\n
   event = module.newContent(portal_type=portal_type, \n
                             description=description, \n
                             title=title, \n
                             follow_up=follow_up,\n
                             text_content=text_content) # text_format is set by Event_init\n
-  count += 1\n
-  # Trigger appropriate workflow action\n
-  if direction == \'incoming\':\n
-    event.setSourceValue(person)\n
-    event.setDestinationValue(user_person)\n
-    event.receive()\n
-  else:\n
-    event.plan()\n
-    event.setDestinationValue(person)\n
-    event.setSourceValue(user_person)\n
-\n
+  event.plan()\n
+  event.setDestinationValueList(person_list)\n
+  event.setSourceValue(user_person)\n
+  count = 1\n
 \n
 # Redirect to the event module (but is this the best place to go since events are not yet indexed ?)\n
 portal_status_message = translateString("Created and associated ${count} new ${portal_type}(s) to the selected ticket.", \n
                                     mapping = dict(portal_type = portal_type, count=count))\n
 context.Base_redirect(form_id, keep_items = dict(portal_status_message=portal_status_message, selection_name=selection_name, selection_index=selection_index), **kw)\n
-</string> </value>
+
+
+]]></string> </value>
         </item>
         <item>
             <key> <string>_code</string> </key>
@@ -122,7 +142,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>portal_type, title, description, direction, selection_name, selection_index, follow_up, text_content, form_id, **kw</string> </value>
+            <value> <string>portal_type, title, description, direction, selection_name, selection_index, follow_up, single_event=0, text_content, form_id, **kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -142,7 +162,7 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>9</int> </value>
+                        <value> <int>10</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
@@ -155,6 +175,7 @@
                             <string>selection_name</string>
                             <string>selection_index</string>
                             <string>follow_up</string>
+                            <string>single_event</string>
                             <string>text_content</string>
                             <string>form_id</string>
                             <string>kw</string>
@@ -170,6 +191,7 @@
                             <string>person</string>
                             <string>event</string>
                             <string>_inplacevar_</string>
+                            <string>len</string>
                             <string>dict</string>
                             <string>portal_status_message</string>
                             <string>_apply_</string>
@@ -184,7 +206,11 @@
         <item>
             <key> <string>func_defaults</string> </key>
             <value>
-              <none/>
+              <tuple>
+                <int>0</int>
+                <none/>
+                <none/>
+              </tuple>
             </value>
         </item>
         <item>

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog.xml?rev=16375&r1=16374&r2=16375&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog.xml Fri Sep 14 15:49:02 2007
@@ -103,6 +103,7 @@
                         <string>your_description</string>
                         <string>your_direction</string>
                         <string>your_follow_up</string>
+                        <string>your_single_event</string>
                       </list>
                     </value>
                 </item>

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_description.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_description.xml?rev=16375&r1=16374&r2=16375&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_description.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_description.xml Fri Sep 14 15:49:02 2007
@@ -87,7 +87,7 @@
                     <value> <string>Click to edit the target</string> </value>
                 </item>
                 <item>
-                    <key>                 <string>width</string> </key>
+                    <key> <string>width</string> </key>
                     <value> <int>40</int> </value>
                 </item>
               </dictionary>

Added: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_single_event.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_single_event.xml?rev=16375&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_single_event.xml (added)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_single_event.xml Fri Sep 14 15:49:02 2007
@@ -1,0 +1,177 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>your_single_event</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Single Event</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_text_content.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_text_content.xml?rev=16375&r1=16374&r2=16375&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_text_content.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_text_content.xml Fri Sep 14 15:49:02 2007
@@ -60,15 +60,15 @@
             <value>
               <dictionary>
                 <item>
-                    <key>                 <string>css_class</string> </key>
+                    <key> <string>css_class</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key>                 <string>default</string> </key>
+                    <key> <string>default</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key>                 <string>editable</string> </key>
+                    <key> <string>editable</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
@@ -84,13 +84,13 @@
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key>                 <string>text_editor</string> </key>
+                    <key> <string>text_editor</string> </key>
                     <value>
                       <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>title</string> </key>
+                    <key> <string>title</string> </key>
                     <value> <string></string> </value>
                 </item>
               </dictionary>
@@ -101,15 +101,15 @@
             <value>
               <dictionary>
                 <item>
-                    <key>                 <string>css_class</string> </key>
+                    <key> <string>css_class</string> </key>
                     <value> <string>page</string> </value>
                 </item>
                 <item>
-                    <key>                 <string>default</string> </key>
+                    <key> <string>default</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key>                 <string>editable</string> </key>
+                    <key> <string>editable</string> </key>
                     <value> <int>1</int> </value>
                 </item>
                 <item>
@@ -125,11 +125,11 @@
                     <value> <string>Click to edit the target</string> </value>
                 </item>
                 <item>
-                    <key>                 <string>text_editor</string> </key>
+                    <key> <string>text_editor</string> </key>
                     <value> <string>text_area</string> </value>
                 </item>
                 <item>
-                    <key>                 <string>title</string> </key>
+                    <key> <string>title</string> </key>
                     <value> <string>Body</string> </value>
                 </item>
               </dictionary>

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_title.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_title.xml?rev=16375&r1=16374&r2=16375&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_title.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/PersonModule_viewNewEventDialog/your_title.xml Fri Sep 14 15:49:02 2007
@@ -75,7 +75,7 @@
             <value>
               <dictionary>
                 <item>
-                    <key>                 <string>display_width</string> </key>
+                    <key> <string>display_width</string> </key>
                     <value> <int>40</int> </value>
                 </item>
                 <item>

Modified: erp5/trunk/bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/states/planned.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/states/planned.xml?rev=16375&r1=16374&r2=16375&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/states/planned.xml (original)
+++ erp5/trunk/bt5/erp5_crm/WorkflowTemplateItem/portal_workflow/event_workflow/states/planned.xml Fri Sep 14 15:49:02 2007
@@ -3,11 +3,8 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.DCWorkflow.States</string>
-          <string>StateDefinition</string>
-        </tuple>
-        <none/>
+        <global name="StateDefinition" module="Products.DCWorkflow.States"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
@@ -40,6 +37,8 @@
             <key> <string>transitions</string> </key>
             <value>
               <tuple>
+                <string>delete</string>
+                <string>delete_action</string>
                 <string>order</string>
                 <string>order_action</string>
               </tuple>




More information about the Erp5-report mailing list