[Erp5-report] r26144 - in /erp5/trunk/bt5/erp5_web: SkinTemplateItem/portal_skins/erp5_web/...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 24 18:24:44 CET 2009


Author: fabien
Date: Tue Mar 24 18:24:43 2009
New Revision: 26144

URL: http://svn.erp5.org?rev=26144&view=rev
Log:
2009-03-24 fabien
* move some scripts from km to here. This scripts are usefull to display listbox search style.
* some method need to be renamed after been moved so change the name everywhere

Added:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerInfoList.xml
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerValueList.xml
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Document_getPopupInfo.xml
Modified:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_viewSearchRenderer.xml
    erp5/trunk/bt5/erp5_web/bt/change_log
    erp5/trunk/bt5/erp5_web/bt/revision

Added: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerInfoList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerInfoList.xml?rev=26144&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerInfoList.xml (added)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerInfoList.xml [utf8] Tue Mar 24 18:24:43 2009
@@ -1,0 +1,158 @@
+<?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
+  Returns a list of dictionaries with information about the owners of\n
+  the document in the form:\n
+\n
+  {\n
+    \'url\': person_url,\n
+    \'title\': person_title,\n
+    \'email\': person_email,\n
+  }\n
+"""\n
+\n
+info_list = []\n
+\n
+person_list = context.Base_getOwnerValueList()\n
+\n
+for person_object in person_list:\n
+  person_title = person_object.getTitle() or person_object.getReference(\'\')\n
+  person_url = \'%s/view\' % person_object.absolute_url()\n
+  person_email = person_object.getDefaultEmailText(\'\')\n
+\n
+  info_list.append(dict(title=person_title, email=person_email, url=person_url))\n
+\n
+return info_list\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <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>info_list</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>person_list</string>
+                            <string>_getiter_</string>
+                            <string>person_object</string>
+                            <string>person_title</string>
+                            <string>person_url</string>
+                            <string>person_email</string>
+                            <string>dict</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>Base_getOwnerInfoList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerValueList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerValueList.xml?rev=26144&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerValueList.xml (added)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_getOwnerValueList.xml [utf8] Tue Mar 24 18:24:43 2009
@@ -1,0 +1,162 @@
+<?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
+  Returns the list of owners of the given context. Owners\n
+  are normally Person objects in ERP5. However, this behaviour\n
+  could be extended in the future or for specific projects.\n
+\n
+  NOTE: we usually asume that there is only a single owner\n
+  or that, at least,  only the first owner matters for\n
+  the "My Documents" list.\n
+\n
+  TODO:\n
+  - how can we make sure that is is consistent with \n
+    ERP5Site_getAuthenticatedMemberPersonValue \n
+    in erp5_base ?\n
+"""\n
+from zExceptions import Unauthorized\n
+owner_value_list = []\n
+try:\n
+  owner_id_list = [i[0] for i in context.get_local_roles() if \'Owner\' in i[1]]\n
+except Unauthorized:\n
+  owner_id_list = []\n
+\n
+if len(owner_id_list):\n
+  return context.portal_catalog(portal_type=\'Person\', reference=owner_id_list)\n
+else:\n
+  return []\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <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>zExceptions</string>
+                            <string>Unauthorized</string>
+                            <string>owner_value_list</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>i</string>
+                            <string>_getitem_</string>
+                            <string>owner_id_list</string>
+                            <string>len</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>Base_getOwnerValueList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Document_getPopupInfo.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Document_getPopupInfo.xml?rev=26144&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Document_getPopupInfo.xml (added)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Document_getPopupInfo.xml [utf8] Tue Mar 24 18:24:43 2009
@@ -1,0 +1,202 @@
+<?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
+    Generate current document\'s information structure needed to be rendered \n
+    by web widget Document_viewPopupTemplate.\n
+"""\n
+from zExceptions import Unauthorized\n
+\n
+translateString = context.Base_translateString\n
+doc_info = {}\n
+owner_list = context.Base_getOwnerInfoList()\n
+doc_info[\'owner\'] = \'; \'.join([owner[\'title\'] for owner in owner_list])\n
+\n
+if context.getModificationDate() is not None:\n
+  doc_info[\'modification_date\'] = context.WebSite_getFancyRelativeDate(context.getModificationDate())\n
+  \n
+publication_date = context.Document_getLastWorkflowStateEntryDate(state=(\'public,\'),\n
+                                                                  state_name=\'validation_state\')\n
+if publication_date is not None:\n
+  doc_info[\'publication_date\'] = context.WebSite_getFancyRelativeDate(publication_date)\n
+  \n
+release_date = context.Document_getLastWorkflowStateEntryDate(state=(\'released,\'),\n
+                                                              state_name=\'validation_state\')\n
+if release_date is not None:\n
+  doc_info[\'release_date\'] = context.WebSite_getFancyRelativeDate(release_date)\n
+  \n
+try:\n
+  doc_info[\'status\'] = context.getTranslatedValidationStateTitle() or \'\'\n
+except AttributeError:\n
+  doc_info[\'status\'] = \'\'\n
+  \n
+try:\n
+  doc_info[\'group\'] = context.getGroupTitle() or \'\'\n
+except AttributeError:\n
+  doc_info[\'group\'] = \'\'\n
+  \n
+try:\n
+  doc_info[\'project\'] = context.getFollowUpTitle(checked_permission=\'View\') or \'\'\n
+except (AttributeError, Unauthorized):\n
+  doc_info[\'project\'] = \'\'\n
+\n
+try:\n
+  doc_info[\'language\'] = context.getLanguage() or \'\'\n
+except AttributeError:\n
+  pass\n
+\n
+# add web sections document belongs too\n
+if website is None:\n
+  website = context.getWebSiteValue()  \n
+sections = []\n
+for websection in website.getWebSectionValueList(context):\n
+  sections.append({\'title\': websection.getCompactTranslatedTitle(),\n
+                   \'url\': websection.absolute_url()})\n
+doc_info[\'sections\'] = sections\n
+\n
+return context.Document_viewPopupTemplate(**doc_info)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>website=None</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>website</string>
+                            <string>zExceptions</string>
+                            <string>Unauthorized</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>translateString</string>
+                            <string>doc_info</string>
+                            <string>owner_list</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>owner</string>
+                            <string>_getitem_</string>
+                            <string>_write_</string>
+                            <string>None</string>
+                            <string>publication_date</string>
+                            <string>release_date</string>
+                            <string>AttributeError</string>
+                            <string>sections</string>
+                            <string>websection</string>
+                            <string>_apply_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Document_getPopupInfo</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_viewSearchRenderer.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_viewSearchRenderer.xml?rev=26144&r1=26143&r2=26144&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_viewSearchRenderer.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_viewSearchRenderer.xml [utf8] Tue Mar 24 18:24:43 2009
@@ -75,7 +75,8 @@
                       i18n:translate="" i18n:domain="ui">Standard Type</option>\n
             </tal:block>\n
           </select>\n
-          <input i18n:domain="ui" i18n:attributes="value" type="submit" name="search_area/WebSite_viewQuickSearchResultList:method" value="Search"/>\n
+          <input i18n:domain="ui" i18n:attributes="value" type="submit"\n
+          name="search_area/ERP5Site_viewQuickSearchResultList:method" value="Search"/>\n
         </div>\n
         <div class="searchOptions">\n
           <a tal:attributes="href string: search_area/Base_viewAdvancedSearchDialog" i18n:translate="" i18n:domain="ui">Advanced Search</a> | <a href="javascript:void 0" onclick="javascript:openTips();" value="" i18n:translate="" i18n:domain="ui">Search Tips</a>\n

Modified: erp5/trunk/bt5/erp5_web/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/change_log?rev=26144&r1=26143&r2=26144&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/bt/change_log [utf8] Tue Mar 24 18:24:43 2009
@@ -1,3 +1,7 @@
+2009-03-24 fabien
+* move some scripts from km to here. This scripts are usefull to display listbox search style.
+* some method need to be renamed after been moved so change the name everywhere
+
 2009-01-25 jps
 * Renamed erp5_web_default_theme to clarify the fact that there is no default theme in erp5_web and that erp5_web is a framework to build Web sites based on ERP5.
 

Modified: erp5/trunk/bt5/erp5_web/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/revision?rev=26144&r1=26143&r2=26144&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/bt/revision [utf8] Tue Mar 24 18:24:43 2009
@@ -1,1 +1,1 @@
-759
+767




More information about the Erp5-report mailing list