[Erp5-report] r34243 ivan - in /erp5/trunk/bt5/erp5_discussion: SkinTemplateItem/portal_ski...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 1 12:54:33 CEST 2010


Author: ivan
Date: Thu Apr  1 12:54:30 2010
New Revision: 34243

URL: http://svn.erp5.org?rev=34243&view=rev
Log:
Proxify form.
Hide some fields ( group & site) from intial thread creation form and use user's assignment to determine them.

Added:
    erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserAssignmentDict.xml
Modified:
    erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_createNewDiscussionThread.xml
    erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_group_list.xml
    erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_site_list.xml
    erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Preference_viewForumSettings/my_preferred_forum_signature.xml
    erp5/trunk/bt5/erp5_discussion/bt/revision

Modified: erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_createNewDiscussionThread.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_createNewDiscussionThread.xml?rev=34243&r1=34242&r2=34243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_createNewDiscussionThread.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_createNewDiscussionThread.xml [utf8] Thu Apr  1 12:54:30 2010
@@ -56,12 +56,18 @@
             <value> <string>"""\n
  This script allows to create a new Discussion Thread.\n
 """\n
+MARKER = [\'\', None, []]\n
 \n
 portal = context.getPortalObject()\n
 person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
 \n
 version = \'001\'\n
 language = portal.Localizer.get_selected_language()\n
+user_assignment_dict = portal.ERP5Site_getUserAssignmentDict()\n
+if group_list in MARKER:\n
+  group_list = user_assignment_dict[\'group_list\']\n
+if site_list in MARKER:\n
+  site_list = user_assignment_dict[\'site_list\']\n
 discussion_thread = portal.discussion_thread_module.newContent(\n
                       portal_type = "Discussion Thread",\n
                       title = title,\n
@@ -72,6 +78,7 @@
                       subject_list=subject_list,\n
                       classification=classification,\n
                       group_list=group_list,\n
+                      site_list=site_list,\n
                       reference=reference)\n
 discussion_post = discussion_thread.newContent(\n
                       portal_type = "Discussion Post",\n
@@ -80,6 +87,7 @@
                       source_value = person,\n
                       version = version,\n
                       language = language)\n
+\n
 # depending on security model Thread and Post can be directly published or shared\n
 portal_status_message = "New discussion created. Your post will be reviewed for approval."\n
 discussion_thread.submit()\n
@@ -97,7 +105,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>title, text_content, form_id, predecessor=None, description=None, subject_list=None, classification=None, group_list=None, reference=None,**kw</string> </value>
+            <value> <string>title, text_content, form_id, predecessor=None, description=None, subject_list=None, classification=None, group_list=None, site_list=None, reference=None,**kw</string> </value>
         </item>
         <item>
             <key> <string>_proxy_roles</string> </key>
@@ -123,7 +131,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>
@@ -137,14 +145,19 @@
                             <string>subject_list</string>
                             <string>classification</string>
                             <string>group_list</string>
+                            <string>site_list</string>
                             <string>reference</string>
                             <string>kw</string>
+                            <string>None</string>
+                            <string>MARKER</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>portal</string>
                             <string>person</string>
                             <string>version</string>
                             <string>language</string>
+                            <string>user_assignment_dict</string>
+                            <string>_getitem_</string>
                             <string>discussion_thread</string>
                             <string>discussion_post</string>
                             <string>portal_status_message</string>
@@ -167,6 +180,7 @@
                 <none/>
                 <none/>
                 <none/>
+                <none/>
               </tuple>
             </value>
         </item>

Modified: erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_group_list.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_group_list.xml?rev=34243&r1=34242&r2=34243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_group_list.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_group_list.xml [utf8] Thu Apr  1 12:54:30 2010
@@ -12,7 +12,9 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list/>
+              <list>
+                <string>enabled</string>
+              </list>
             </value>
         </item>
         <item>
@@ -73,6 +75,10 @@
             <value>
               <dictionary>
                 <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
                     <key> <string>field_id</string> </key>
                     <value> <string>my_group_list</string> </value>
                 </item>

Modified: erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_site_list.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_site_list.xml?rev=34243&r1=34242&r2=34243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_site_list.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog/my_site_list.xml [utf8] Thu Apr  1 12:54:30 2010
@@ -12,7 +12,9 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list/>
+              <list>
+                <string>enabled</string>
+              </list>
             </value>
         </item>
         <item>
@@ -73,6 +75,10 @@
             <value>
               <dictionary>
                 <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
                     <key> <string>field_id</string> </key>
                     <value> <string>my_site_list</string> </value>
                 </item>

Added: erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserAssignmentDict.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserAssignmentDict.xml?rev=34243&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserAssignmentDict.xml (added)
+++ erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/ERP5Site_getUserAssignmentDict.xml [utf8] Thu Apr  1 12:54:30 2010
@@ -1,0 +1,164 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </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>"""\n
+  Get user assignment details.\n
+"""\n
+from Products.ERP5Type.Cache import CachingMethod\n
+\n
+portal = context.getPortalObject()\n
+result = {\'group_list\': [],\n
+          \'site_list\': [],\n
+          \'function_list\': [],\n
+          \'destination_trade_relative_url\': None}\n
+person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
+if person is None:\n
+  return result\n
+\n
+def getAssignmentDict(username):\n
+  person = portal.restrictedTraverse(person_relative_url)\n
+  assignment_list = person.searchFolder(portal_type = \'Assignment\', \\\n
+                                        validation_state = \'open\')\n
+  for assignment in assignment_list:\n
+    assignment = assignment.getObject()\n
+    result[\'group_list\'].extend(assignment.getGroupList())\n
+    result[\'function_list\'].extend(assignment.getFunctionList())\n
+    result[\'site_list\'].extend(assignment.getSiteList())\n
+    result[\'destination_trade_relative_url\'] = assignment.getDestinationTradeRelativeUrl()\n
+  return result\n
+\n
+person_relative_url = person.getRelativeUrl()\n
+getAssignmentDict = CachingMethod(getAssignmentDict,\n
+                               ("ERP5Site_getUserAssignmentDict",),\n
+                                cache_factory=\'erp5_ui_short\')\n
+return getAssignmentDict(person_relative_url)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>Products.ERP5Type.Cache</string>
+                            <string>CachingMethod</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>None</string>
+                            <string>result</string>
+                            <string>person</string>
+                            <string>person_relative_url</string>
+                            <string>getAssignmentDict</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_getUserAssignmentDict</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Preference_viewForumSettings/my_preferred_forum_signature.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Preference_viewForumSettings/my_preferred_forum_signature.xml?rev=34243&r1=34242&r2=34243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Preference_viewForumSettings/my_preferred_forum_signature.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Preference_viewForumSettings/my_preferred_forum_signature.xml [utf8] Thu Apr  1 12:54:30 2010
@@ -3,12 +3,20 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <global name="TextAreaField" module="Products.Formulator.StandardFields"/>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
         <tuple/>
       </tuple>
     </pickle>
     <pickle>
       <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
         <item>
             <key> <string>id</string> </key>
             <value> <string>my_preferred_forum_signature</string> </value>
@@ -21,22 +29,6 @@
                     <key> <string>external_validator_failed</string> </key>
                     <value> <string>The input failed the external validator.</string> </value>
                 </item>
-                <item>
-                    <key> <string>line_too_long</string> </key>
-                    <value> <string>A line was too long.</string> </value>
-                </item>
-                <item>
-                    <key> <string>required_not_found</string> </key>
-                    <value> <string>Input is required but no input given.</string> </value>
-                </item>
-                <item>
-                    <key> <string>too_long</string> </key>
-                    <value> <string>You entered too many characters.</string> </value>
-                </item>
-                <item>
-                    <key> <string>too_many_lines</string> </key>
-                    <value> <string>You entered too many lines.</string> </value>
-                </item>
               </dictionary>
             </value>
         </item>
@@ -45,75 +37,15 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>alternate_name</string> </key>
+                    <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key> <string>css_class</string> </key>
+                    <key> <string>form_id</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>height</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_length</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_linelength</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_lines</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>whitespace_preserve</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>width</string> </key>
+                    <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
               </dictionary>
@@ -124,75 +56,15 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>alternate_name</string> </key>
+                    <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
                 </item>
                 <item>
-                    <key> <string>css_class</string> </key>
+                    <key> <string>form_id</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>height</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_length</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_linelength</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_lines</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>whitespace_preserve</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>width</string> </key>
+                    <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
               </dictionary>
@@ -203,76 +75,20 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>alternate_name</string> </key>
-                    <value> <string></string> </value>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_text_area_field</string> </value>
                 </item>
                 <item>
-                    <key> <string>css_class</string> </key>
-                    <value> <string></string> </value>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</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> <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>height</string> </key>
-                    <value> <int>5</int> </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>max_length</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_linelength</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>max_lines</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <int>0</int> </value>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
                 </item>
                 <item>
                     <key> <string>title</string> </key>
                     <value> <string>Signature</string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>whitespace_preserve</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>width</string> </key>
-                    <value> <int>40</int> </value>
                 </item>
               </dictionary>
             </value>

Modified: erp5/trunk/bt5/erp5_discussion/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_discussion/bt/revision?rev=34243&r1=34242&r2=34243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_discussion/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_discussion/bt/revision [utf8] Thu Apr  1 12:54:30 2010
@@ -1,1 +1,1 @@
-34
+36




More information about the Erp5-report mailing list