[Erp5-report] r45433 gabriel - in /erp5/trunk/bt5/erp5_web_ung_theme: SkinTemplateItem/port...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 14 14:01:14 CEST 2011


Author: gabriel
Date: Thu Apr 14 14:01:13 2011
New Revision: 45433

URL: http://svn.erp5.org?rev=45433&view=rev
Log:
rename script and remove manage proxy role because if normal user use this script, the user will access a wrong knowledge pad

Added:
    erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadgetList.xml
Removed:
    erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadget.xml
Modified:
    erp5/trunk/bt5/erp5_web_ung_theme/bt/revision

Removed: erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadget.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadget.xml?rev=45432&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadget.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadget.xml (removed)
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-    </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>portal_catalog = context.portal_catalog\n
-\n
-knowledge_pad = portal_catalog.getResultValue(portal_type="Knowledge Pad",\n
-                                              publication_section_uid=context.getUid(),\n
-                                              validation_state=["visible", "public"])\n
-\n
-knowledge_box = knowledge_pad.newContent(portal_type="Knowledge Box")\n
-gadget_relative_url = "portal_gadgets/%s" % gadget_id\n
-gadget = portal_catalog.getResultValue(portal_type="Gadget", id=gadget_id)\n
-if gadget.getValidationState() == "invisible":\n
-  gadget.visible()\n
-knowledge_box.setSpecialise(gadget_relative_url)\n
-knowledge_box.visible()\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>gadget_id</string> </value>
-        </item>
-        <item>
-            <key> <string>_proxy_roles</string> </key>
-            <value>
-              <tuple>
-                <string>Manager</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>WebSection_addGadget</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>

Added: erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadgetList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadgetList.xml?rev=45433&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadgetList.xml (added)
+++ erp5/trunk/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_addGadgetList.xml [utf8] Thu Apr 14 14:01:13 2011
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+    </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>portal_catalog = context.portal_catalog\n
+\n
+gadget_id_list = context.REQUEST.form.get("gadget_id_list")\n
+if not gadget_id_list:\n
+  return None\n
+\n
+gadget_id_list = gadget_id_list.split(",")\n
+knowledge_pad = portal_catalog.getResultValue(portal_type="Knowledge Pad",\n
+                                              publication_section_uid=context.getUid(),\n
+                                              validation_state=["visible", "public"])\n
+\n
+for gadget_id in gadget_id_list:\n
+ knowledge_box = knowledge_pad.newContent(portal_type="Knowledge Box")\n
+ gadget_relative_url = "portal_gadgets/%s" % gadget_id\n
+ gadget = portal_catalog.getResultValue(portal_type="Gadget", id=gadget_id)\n
+ if gadget.getValidationState() == "invisible":\n
+  gadget.visible()\n
+ knowledge_box.setSpecialise(gadget_relative_url)\n
+ knowledge_box.visible()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>WebSection_addGadgetList</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_web_ung_theme/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web_ung_theme/bt/revision?rev=45433&r1=45432&r2=45433&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web_ung_theme/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_web_ung_theme/bt/revision [utf8] Thu Apr 14 14:01:13 2011
@@ -1 +1 @@
-353
\ No newline at end of file
+354
\ No newline at end of file



More information about the Erp5-report mailing list