Commit 4772011b authored by Ivan Tyagov's avatar Ivan Tyagov

Split core script from widgets.

Add comments.
Fix minor bugs.
Add test for shopping cart.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15063 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f3b6f5ce
......@@ -68,7 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from random import choice\n
<value> <string>"""\n
Generate random id which is generally used as a session ID.\n
"""\n
from random import choice\n
import string\n
return \'\'.join([choice(string.letters) for i in range(max_long)])\n
</string> </value>
......
......@@ -204,10 +204,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\' This script is a sceleton for implementing discounts per customer basis.\n
<value> <string>"""\n
This script is a sceleton for implementing discounts per customer basis.\n
Because it\'s specific for every shop it needs to be implemented accordingly. \n
See also SaleOrder_viewDiscountRenderer. \n
\'\'\'\n
"""\n
\n
#customer = context.SaleOrder_getShoppingCartCustomer()\n
return None\n
</string> </value>
......
......@@ -204,12 +204,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\' This script will find applicable taxes for customer based on his/hers location for example.\n
<value> <string>"""\n
This script will find applicable taxes for customer based on his/hers location.\n
For example.\n
- B2B in EU in same country, tax \n
- B2B in EU in different country, no tax \n
- B2B and B2P from EU to outside EU, no tax \n
- B2P in EU, tax\n
\'\'\'\n
"""\n
\n
#customer = context.SaleOrder_getShoppingCartCustomer()\n
return {context.Base_translateString(\'VAT\'): 20.0,}\n
</string> </value>
......
......@@ -70,7 +70,11 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
quantity = int(context.REQUEST.get(\'field_your_buy_quantity\', 0))\n
"""\n
Add resource to shopping cart.\n
"""\n
\n
quantity = int(field_your_buy_quantity) #(context.REQUEST.get(\'field_your_buy_quantity\', 0))\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
\n
......@@ -117,7 +121,7 @@ context.Base_redirect(\'view\', \\\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>resource=None</string> </value>
<value> <string>resource=None, field_your_buy_quantity = 0</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -137,17 +141,18 @@ context.Base_redirect(\'view\', \\\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>resource</string>
<string>field_your_buy_quantity</string>
<string>int</string>
<string>quantity</string>
<string>_getattr_</string>
<string>context</string>
<string>quantity</string>
<string>shopping_cart</string>
<string>shopping_cart_items</string>
<string>None</string>
......@@ -172,6 +177,7 @@ context.Base_redirect(\'view\', \\\n
<value>
<tuple>
<none/>
<int>0</int>
</tuple>
</value>
</item>
......
......@@ -210,9 +210,10 @@ translateString = context.Base_translateString\n
\n
if isAnon:\n
## create first an account for user\n
context.Base_redirect(\'WebSite_joinForm\', \\\n
keep_items={\'portal_status_message\': translateString("You need to create an account. If you already have please login.", mapping = dict())})\n
return\n
msg = translateString("You need to create an account to continue If you already have please login.")\n
context.Base_redirect(\'WebSite_createWebSiteAccountForm\', \\\n
keep_items={\'editable_mode\': 1,\n
\'portal_status_message\': msg})\n
else:\n
## redirect to final confirmation form\n
context.Base_redirect(\'SaleOrder_viewAsWebConfirm\')\n
......@@ -272,7 +273,7 @@ else:\n
<string>request</string>
<string>isAnon</string>
<string>translateString</string>
<string>dict</string>
<string>msg</string>
</tuple>
</value>
</item>
......
......@@ -204,7 +204,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>translateString = context.Base_translateString\n
<value> <string>"""\n
Delete a shopping cart item.\n
"""\n
\n
translateString = context.Base_translateString\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
if field_my_order_line_id is not None:\n
......
......@@ -206,6 +206,11 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Update shopping cart by chnage items quantity and setting preferred \n
shipping.\n
"""\n
\n
from Products.ERP5Type.Document import newTempOrderLine\n
\n
request = context.REQUEST\n
......@@ -216,13 +221,14 @@ shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping
shopping_cart_products_items = filter(lambda x: x.getId()!=\'shipping_method\', shopping_cart_items)\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
## when we have one item in shoppping cart we get \n
## quantity as a string rather as a list\n
if isinstance(quantity, str):\n
# handle change in quantity for shopping items\n
if quantity is not None:\n
## when we have one item in shoppping cart we get \n
## quantity as a string rather as a list\n
if isinstance(quantity, str):\n
quantity = [quantity]\n
\n
counter = 0\n
for order_line in shopping_cart_products_items:\n
counter = 0\n
for order_line in shopping_cart_products_items:\n
new_quantity = int(quantity[counter])\n
if new_quantity>=1:\n
order_line.setQuantity(new_quantity)\n
......@@ -312,6 +318,7 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<string>filter</string>
<string>shopping_cart_products_items</string>
<string>shopping_cart</string>
<string>None</string>
<string>isinstance</string>
<string>str</string>
<string>counter</string>
......@@ -320,7 +327,6 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<string>int</string>
<string>_getitem_</string>
<string>new_quantity</string>
<string>None</string>
<string>shipping</string>
<string>getattr</string>
<string>dict</string>
......
......@@ -204,16 +204,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" This script is called by external payment system.\n
Here you can check if payment was successfull or not."""\n
<value> <string>""" \n
This script is called by external payment system.\n
Here you can check if payment was successfull or not.\n
"""\n
\n
# XXX: implement external payment check\n
\n
## TODO: implement payment check for CyberMut\n
# XXX: finalize order\n
\n
\n
## finalize order\n
\n
## redirect\n
# XXX: redirect\n
</string> </value>
</item>
<item>
......
......@@ -204,7 +204,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n
<value> <string>"""\n
Do whatever is necessary to finalize an order.\n
This script is called after customer completes shopping.\n
"""\n
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
......@@ -212,14 +216,15 @@ customer = context.SaleOrder_getShoppingCartCustomer()\n
\n
if isAnon:\n
## create first an account for user\n
context.Base_redirect(\'WebSite_newCustomerAccountForm\', \\\n
keep_items={\'portal_status_message\': translateString("You need to create an account.", mapping = dict())})\n
msg = translateString("You need to create an account to continue If you already have please login.")\n
context.Base_redirect(\'WebSite_createWebSiteAccountForm\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'editable_mode\': 1})\n
return\n
\n
## XXX: Implement check if payment is sucessfull\n
\n
order_module = context.getPortalObject().sale_order_module\n
sale_order = order_module.newContent(portal_type=\'Sale Order\')\n
sale_order_module = context.getPortalObject().sale_order_module\n
sale_order = sale_order_module.newContent(portal_type=\'Sale Order\')\n
sale_order.setDestination(customer.getRelativeUrl())\n
\n
## set order default currency\n
......@@ -296,8 +301,8 @@ context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
<string>True</string>
<string>shopping_cart_items</string>
<string>customer</string>
<string>dict</string>
<string>order_module</string>
<string>msg</string>
<string>sale_order_module</string>
<string>sale_order</string>
<string>_getiter_</string>
<string>order_line</string>
......
......@@ -204,7 +204,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\' This will return all Products that have set product_line=\'shipping\'. \'\'\'\n
<value> <string>"""\n
This will return all Products that have set product_line=\'shipping\'.\n
Such products are used for shipping purposes i.e. they can not be sold.\n
"""\n
\n
result = [r.getObject() for r in context.portal_catalog(portal_type=\'Product\')]\n
return [o for o in result if o.getProductLine() in (\'shipping\',)]\n
</string> </value>
......
......@@ -68,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" Add resource to current (or to be created shopping cart). """\n
<value> <string>""" \n
Add resource to current (or to be created shopping cart). \n
"""\n
from DateTime import DateTime\n
\n
request = context.REQUEST\n
......
......@@ -84,8 +84,8 @@ def getFoundUserRelativeUrl(user_id):\n
user_object = user_list[0].getObject()\n
return user_object.getRelativeUrl()\n
\n
user_relative_url = CachingMethod(getFoundUserRelativeUrl, script.id)(user_id)\n
#user_relative_url = getFoundUserRelativeUrl(user_id)\n
#user_relative_url = CachingMethod(getFoundUserRelativeUrl, script.id)(user_id)\n
user_relative_url = getFoundUserRelativeUrl(user_id)\n
\n
if user_relative_url is not None:\n
return context.getPortalObject().restrictedTraverse(user_relative_url)\n
......@@ -149,7 +149,6 @@ if user_relative_url is not None:\n
<string>user_id</string>
<string>None</string>
<string>getFoundUserRelativeUrl</string>
<string>script</string>
<string>user_relative_url</string>
</tuple>
</value>
......
......@@ -68,7 +68,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" Return default currency used in shopping_cart.\n
<value> <string>""" \n
Return default currency used in shopping_cart.\n
Please update accordingly relative path. \n
XXX: there must be an way to do this better?\n
"""\n
......
......@@ -68,7 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues()\n
<value> <string>"""\n
Return list of shopping cart items.\n
"""\n
shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues()\n
if include_shipping:\n
return shopping_cart_order_lines\n
else:\n
......
......@@ -68,7 +68,18 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" Calculate total price of temporary RAM based Sale Order. """\n
<value> <string>""" \n
Calculate total price of temporary RAM based Sale Order.\n
\n
Price is based on three main components:\n
- shopping cart items\n
- applicable taxes (based on Person\'s location and shop\'s location)\n
- shipping costs (same as applicable taxes including type of shopping cart item\n
for example online materials doesn\'t require shipping)\n
\n
Script can optionally include currency.\n
"""\n
\n
total = 0.0\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping)\n
for order_line in shopping_cart_items:\n
......
......@@ -204,8 +204,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\' XXX: implement this check based on shopping cart content\n
for example if we sell online products there\'s no shipping. \'\'\'\n
<value> <string>\'\'\'\n
XXX: implement this check based on shopping cart content\n
for example if we sell online products there\'s no shipping. \n
\'\'\'\n
\n
return 1\n
</string> </value>
......
......@@ -113,7 +113,7 @@
<tuple>
<string>len</string>
<string>_getattr_</string>
<string>context</string>
<string>context</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>from Products.Formulator.Errors import FormValidationError\n
\n
request = context.REQUEST\n
form_kw = request.form\n
translateString = context.Base_translateString\n
form = context.WebSite_joinForm\n
\n
## extract customer details\n
person_kw = {}\n
field_prefix = \'field_your_\'\n
person_kw[\'career_role\'] = \'internal\'\n
for key in form_kw.keys():\n
if key.startswith(field_prefix):\n
person_kw[key.replace(field_prefix, \'\')] = form_kw[key]\n
\n
## validate form to request\n
try:\n
kw = form.validate_all_to_request(request)\n
validated = True\n
except FormValidationError, validation_errors:\n
validated = False\n
\n
if validated == False:\n
context.REQUEST.set(\'field_errors\', form.ErrorFields(validation_errors))\n
return form(validation_errors)\n
\n
## save customer\n
person_module = context.getPortalObject().person_module\n
person = person_module.newContent(portal_type=\'Person\', **person_kw)\n
person.validate()\n
\n
## add assignment\n
assignment = person.newContent(portal_type="Assignment", title="Commerce customer")\n
assignment.setFunction(\'customer\')\n
assignment.open()\n
\n
## reindex customer so it becomes available as site member\n
person.immediateReindexObject()\n
\n
## set local role to Owner for new user \n
## so he can view/modify ONLY this object\n
person.manage_addLocalRoles(person_kw[\'reference\'], (\'Owner\',)) \n
\n
context.Base_redirect(\'WebSite_login\', \\\n
keep_items={\'portal_status_message\': translateString("Your account was created.", mapping = dict()),\n
\'came_from\': context.absolute_url(),\n
\'__ac_name\': person_kw[\'reference\'],\n
\'__ac_password\': person_kw[\'password\']})\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</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>
<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.Formulator.Errors</string>
<string>FormValidationError</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>form_kw</string>
<string>translateString</string>
<string>form</string>
<string>person_kw</string>
<string>field_prefix</string>
<string>_write_</string>
<string>_getiter_</string>
<string>key</string>
<string>_getitem_</string>
<string>kw</string>
<string>True</string>
<string>validated</string>
<string>validation_errors</string>
<string>False</string>
<string>person_module</string>
<string>_apply_</string>
<string>person</string>
<string>assignment</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>WebSite_createUserAccount</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create user account for website</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_bindings_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_cache_settings_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_permissions_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Manage_WebDAV_Locks_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Manage_properties_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Take_ownership_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Undo_changes_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_View_management_screens_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_WebDAV_Lock_items_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_WebDAV_Unlock_items_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_WebDAV_access_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>REQUEST = context.REQUEST\n
if REQUEST.has_key(\'portal_skin\'):\n
context.portal_skins.clearSkinCookie()\n
\n
REQUEST.RESPONSE.expireCookie(\'__ac\', path=\'/\')\n
\n
translateString = context.Base_translateString\n
context.Base_redirect(\'view\', \\\n
keep_items={\'portal_status_message\': translateString("You have been logged out.", mapping = dict())})\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</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>_getattr_</string>
<string>context</string>
<string>REQUEST</string>
<string>translateString</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>WebSite_logout</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Logout handler</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>OFS.Folder</string>
<string>Folder</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_commerce_widget_library</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>E-Commerce Theme for Web Site</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -4,24 +4,14 @@
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
......@@ -41,24 +31,7 @@
<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>
<dictionary/>
</value>
</item>
</dictionary>
......@@ -67,100 +40,128 @@
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>user_list = context.acl_users.searchUsers(id=editor, exact_match=True)\n
return len(user_list)==0\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<key> <string>_objects</string> </key>
<value>
<none/>
<tuple/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>editor, request</string> </value>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<key> <string>group_list</string> </key>
<value>
<tuple/>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<key> <string>groups</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>2</int> </value>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<key> <string>center</string> </key>
<value>
<tuple>
<string>editor</string>
<string>request</string>
<string>_getattr_</string>
<string>context</string>
<string>True</string>
<string>user_list</string>
<string>len</string>
</tuple>
<list>
<string>my_description</string>
<string>my_reference</string>
<string>my_password</string>
<string>password_confirm</string>
</list>
</value>
</item>
</dictionary>
</state>
</object>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_first_name</string>
<string>my_last_name</string>
<string>my_career_subordination_title</string>
<string>my_gender</string>
<string>my_nationality</string>
<string>my_translated_validation_state_title</string>
</list>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<key> <string>right</string> </key>
<value>
<none/>
<list>
<string>my_default_email_text</string>
<string>my_default_telephone_text</string>
<string>my_default_fax_text</string>
<string>my_default_address_street_address</string>
<string>my_default_address_zip_code</string>
<string>my_default_address_city</string>
<string>my_default_address_region</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_validateUserID</string> </value>
<value> <string>Person_viewAsWeb</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>General</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Is valid user ID provided?</string> </value>
<value> <string>Person</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_description</string>
<string>my_price</string>
<string>your_buy_quantity</string>
<string>submit</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_viewAsShop</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Product_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>web_form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Resource</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_doSelect</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrderModule_viewAsWebSaleOrderList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SaleOrderModule_viewSaleOrderList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>My Orders</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -514,12 +514,7 @@
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>SaleOrder_getFormattedCreationDate</string>
<string>Date</string>
</tuple>
</list>
<list/>
</value>
</item>
</dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>shopping_cart</string>
<string>my_shipping_method</string>
<string>submit</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewAsWeb</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Product_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>web_form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit Shopping Cart</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>shopping_cart</string>
<string>discounts</string>
<string>shipping</string>
<string>taxes</string>
<string>fake_form</string>
<string>customer</string>
<string>submit</string>
<string>fake_payment</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewAsWebConfirm</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Product_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>web_form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Confirm Order</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,9 +12,15 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>form_title</string> </value>
<value> <string>fake_form</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -112,13 +118,14 @@
<key> <string>default</string> </key>
<value> <string encoding="cdata"><![CDATA[
<h2> Register your new account </h2>
<form name="" method="post">\n
</form>
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value> <string>This is a dirty hack to allow online payment form below.</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
......@@ -138,7 +145,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Title</string> </value>
<value> <string>fake_form</string> </value>
</item>
</dictionary>
</value>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>submit</string> </value>
<value> <string>fake_payment</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -103,7 +103,9 @@
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>name</string> </key>
......@@ -130,7 +132,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Create</string> </value>
<value> <string>Fake payment</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -154,11 +156,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSite_createUserAccount:method</string> </value>
<value> <string>SaleOrder_finalizeShopping:method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Submit</string> </value>
<value> <string>Fake Payment</string> </value>
</item>
</dictionary>
</value>
......@@ -166,4 +168,23 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: here/SaleOrder_isConsistent</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>LabelField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>submit</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<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>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>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</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>css_class</string> </key>
<value> <string>hiddenLabel</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>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>Pay Button</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/SaleOrder_viewCreerFormulaireCMRenderer</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: here/SaleOrder_isConsistent</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This diff is collapsed.
2007-06-07 Ivan
* Update. Split core script from widgets
2007-01-30 Ivan
* Update
......
65
\ No newline at end of file
82
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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