Commit 76ecef89 by Georgios Dagkakis

All business templates migrated to new format with files like Python Scripts,…

All business templates migrated to new format with files like Python Scripts, Web Pages, Web Scripts etc. separate to xml
parent 1e028d6d

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -3,7 +3,7 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="WebSite" module="Products.ERP5Type.Document.WebSite"/>
<global name="WebSite" module="Products.ERP5.Document.WebSite"/>
<tuple/>
</tuple>
</pickle>
......@@ -245,7 +245,7 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="WebSiteTraversalHook" module="Products.ERP5Type.Document.WebSite"/>
<global name="WebSiteTraversalHook" module="Products.ERP5.Document.WebSite"/>
<tuple/>
</tuple>
</pickle>
......
document_module
image_module
person_module
\ No newline at end of file
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>cloudooo_erp5_base</skin_folder>
<skin_selection>View,Cloudooo</skin_selection>
<skin_selection>Cloudooo,View</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>cloudooo_erp5_ingestion</skin_folder>
<skin_selection>View,Cloudooo</skin_selection>
<skin_selection>Cloudooo,View</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>cloudooo_web</skin_folder>
......
"""
Get Person assignment details.
"""
#For Cloudooo : Proxify it to allow anonymous user to discover metadata of uploaded file
from Products.ERP5Type.Cache import CachingMethod
portal = context.getPortalObject()
result = {'group_list': [],
'site_list': [],
'function_list': [],
'destination_trade_relative_url': None}
person = portal.ERP5Site_getAuthenticatedMemberPersonValue(user_name=user_name)
if person is None:
return result
def getAssignmentDict(username):
person = portal.restrictedTraverse(person_relative_url)
assignment_list = person.Person_getAvailableAssignmentValueList()
for assignment in assignment_list:
assignment = assignment.getObject()
result['group_list'].extend(assignment.getGroupList())
result['function_list'].extend(assignment.getFunctionList())
result['site_list'].extend(assignment.getSiteList())
result['destination_trade_relative_url'] = assignment.getDestinationTradeRelativeUrl()
return result
person_relative_url = person.getRelativeUrl()
getAssignmentDict = CachingMethod(getAssignmentDict,
("ERP5Site_getPersonAssignmentDict",),
cache_factory='erp5_ui_short')
return getAssignmentDict(person_relative_url)
......@@ -49,43 +49,6 @@
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Get Person assignment details.\n
"""\n
#For Cloudooo : Proxify it to allow anonymous user to discover metadata of uploaded file\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(user_name=user_name)\n
\n
if person is None:\n
return result\n
\n
def getAssignmentDict(username):\n
person = portal.restrictedTraverse(person_relative_url)\n
assignment_list = person.Person_getAvailableAssignmentValueList()\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_getPersonAssignmentDict",),\n
cache_factory=\'erp5_ui_short\')\n
return getAssignmentDict(person_relative_url)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>user_name=None</string> </value>
</item>
......
"""Script use by notification message to resolve the mapping"""
#XXX: Commmit it in erp5_base !
return mapping_dict
......@@ -49,13 +49,6 @@
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Script use by notification message to resolve the mapping"""\n
#XXX: Commmit it in erp5_base !\n
return mapping_dict\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>mapping_dict</string> </value>
</item>
......
"""
This script is part of ERP5 Base
The default implementation searches for
documents which are in the user language if any
with same reference.
"""
#XXX : Diff with standart version by using proxy role auditor to allow
# anonymous to find email. May be change workflow instead of this
# Remove as possible hardcoding on default_language
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
# The list of portal types here should be large enough to include
# all portal_types defined in the various sections so that
# href tags which point to a document by reference can still work.
valid_portal_type_list = ('Notification Message',)
# Find the applicable language
if language is None:
language = portal.Localizer.get_selected_language()
# Find the default language
default_language = portal.Localizer.get_default_language() or 'en'
if validation_state is None:
validation_state = ('validated',)
# Search the catalog for all documents matching the reference
# this will only return documents which are accessible by the user
notification_message_list = portal_catalog(reference=reference,
portal_type=valid_portal_type_list,
validation_state=validation_state,
language=language,
sort_on=[('version', 'descending')],
group_by=('reference',),
**kw)
if len(notification_message_list) == 0 and language != default_language:
# Search again with English as a fallback.
notification_message_list = portal_catalog(reference=reference,
portal_type=valid_portal_type_list,
validation_state=validation_state,
language=default_language,
sort_on=[('version', 'descending')],
group_by=('reference',),
**kw)
if len(notification_message_list) == 0:
# Search again without the language
notification_message_list = portal_catalog(reference=reference,
portal_type=valid_portal_type_list,
validation_state=validation_state,
sort_on=[('version', 'descending')],
group_by=('reference',),
**kw)
if len(notification_message_list) == 0:
# Default returns None
notification_message = None
else:
# Try to get the first page on the list
notification_message = notification_message_list[0]
notification_message = notification_message.getObject()
# return the Notification Message
return notification_message
......@@ -49,79 +49,6 @@
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script is part of ERP5 Base\n
\n
The default implementation searches for\n
documents which are in the user language if any\n
with same reference.\n
"""\n
#XXX : Diff with standart version by using proxy role auditor to allow\n
# anonymous to find email. May be change workflow instead of this\n
# Remove as possible hardcoding on default_language\n
\n
\n
portal = context.getPortalObject()\n
portal_catalog = portal.portal_catalog\n
# The list of portal types here should be large enough to include\n
# all portal_types defined in the various sections so that\n
# href tags which point to a document by reference can still work.\n
valid_portal_type_list = (\'Notification Message\',)\n
\n
# Find the applicable language\n
if language is None:\n
language = portal.Localizer.get_selected_language()\n
\n
# Find the default language\n
default_language = portal.Localizer.get_default_language() or \'en\'\n
\n
if validation_state is None:\n
validation_state = (\'validated\',)\n
\n
# Search the catalog for all documents matching the reference\n
# this will only return documents which are accessible by the user\n
\n
notification_message_list = portal_catalog(reference=reference,\n
portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n
language=language,\n
sort_on=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
**kw)\n
\n
if len(notification_message_list) == 0 and language != default_language:\n
# Search again with English as a fallback.\n
notification_message_list = portal_catalog(reference=reference,\n
portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n
language=default_language,\n
sort_on=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
**kw)\n
\n
if len(notification_message_list) == 0:\n
# Search again without the language\n
notification_message_list = portal_catalog(reference=reference,\n
portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n
sort_on=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
**kw)\n
\n
if len(notification_message_list) == 0:\n
# Default returns None\n
notification_message = None\n
else:\n
# Try to get the first page on the list\n
notification_message = notification_message_list[0]\n
notification_message = notification_message.getObject()\n
\n
# return the Notification Message\n
return notification_message\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>reference, language=None, validation_state=None, **kw</string> </value>
</item>
......
#For Cloudooo : Proxify it to allow anonymous user to discover metadata of uploaded file
current_date=DateTime()
assignment_list = []
for assignment in context.contentValues(portal_type='Assignment'):
if assignment.getValidationState() == 'open':
start_date = assignment.getStartDate()
stop_date = assignment.getStopDate()
if start_date is not None and stop_date is not None and start_date <= current_date < stop_date:
assignment_list.append(assignment)
elif start_date is not None and stop_date is None and start_date <= current_date:
assignment_list.append(assignment)
elif stop_date is not None and start_date is None and current_date < stop_date: