Commit 740d21c6 authored by Sebastien Robin's avatar Sebastien Robin

commit modification made to Resource_zGetTrackingList.xml and many small changes made by others


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5947 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 82554a4a
......@@ -69,7 +69,8 @@
<value> <string encoding="cdata"><![CDATA[
from Products.Formulator.Errors import ValidationError, FormValidationError\n
\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
request=context.REQUEST\n
\n
#### Workaround for bug #21\n
......@@ -265,17 +266,19 @@ except FormValidationError, validation_errors:\n
return form(request)\n
\n
else:\n
message = N_("Data+Updated.")\n
if not selection_index:\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url()\n
redirect_url = \'%s/%s?portal_status_message=%s\' % ( context.absolute_url()\n
, form_id\n
, \'portal_status_message=Data+Updated.\'\n
, message\n
)\n
else:\n
redirect_url = \'%s/%s?selection_index=%s&selection_name=%s&%s\' % ( context.absolute_url()\n
redirect_url = \'%s/%s?selection_index=%s&selection_name=%s&portal_status_message=%s\' % ( \n
context.absolute_url()\n
, form_id\n
, selection_index\n
, selection_name\n
, \'portal_status_message=Data+Updated.\'\n
, message\n
)\n
\n
\n
......@@ -339,6 +342,8 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>FormValidationError</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>request</string>
<string>redirect_url</string>
<string>_getitem_</string>
......@@ -393,6 +398,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>field_errors</string>
<string>field_id</string>
<string>callable</string>
<string>message</string>
</tuple>
</value>
</item>
......
......@@ -70,6 +70,8 @@
from Products.Formulator.Errors import ValidationError, FormValidationError\n
from ZTUtils import make_query\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
request=context.REQUEST\n
\n
......@@ -86,7 +88,8 @@ if o is None:\n
if o is not None:\n
o.immediateReindexObject()\n
else:\n
return ValueError, "Sorrry, Error, the calling object was not catalogued. Do not know how to do ?"\n
message = N_("Sorrry, Error, the calling object was not catalogued. Do not know how to do ?")\n
return ValueError, message\n
\n
def checkSameKeys(a , b):\n
"""\n
......@@ -252,7 +255,7 @@ except FormValidationError, validation_errors:\n
request.set(\'field_errors\', field_errors)\n
return form(request)\n
else:\n
message = \'Relation+Unchanged.\'\n
message = N_(\'Relation+Unchanged.\')\n
\n
if redirect_url is None:\n
if not selection_index:\n
......@@ -323,11 +326,14 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>make_query</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>request</string>
<string>None</string>
<string>base_category</string>
<string>o</string>
<string>redirect_url</string>
<string>message</string>
<string>ValueError</string>
<string>checkSameKeys</string>
<string>getOrderedUids</string>
......@@ -363,7 +369,6 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>complete_value</string>
<string>validation_errors</string>
<string>field_errors</string>
<string>message</string>
</tuple>
</value>
</item>
......
......@@ -66,7 +66,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
# make sure nothing is checked after\n
context.portal_selections.setSelectionCheckedUidsFor(selection_name, [])\n
......@@ -81,9 +84,11 @@ REQUEST=context.REQUEST\n
if uids != []:\n
#context.manage_copyObjects(uids=REQUEST[\'uids\'], REQUEST=REQUEST, RESPONSE=REQUEST.RESPONSE)\n
context.manage_copyObjects(uids=uids, REQUEST=REQUEST, RESPONSE=REQUEST.RESPONSE)\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=Item(s)+Copied.\')\n
message = N_("Item(s)+Copied.")\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n
else:\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=Please+select+one+or+more+items+to+copy+first.\')\n
message = N_("Please+select+one+or+more+items+to+copy+first.")\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n
</string> </value>
</item>
<item>
......@@ -136,8 +141,11 @@ else:\n
<string>selection_name</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>selected_uids</string>
<string>REQUEST</string>
<string>message</string>
</tuple>
</value>
</item>
......
......@@ -66,7 +66,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>REQUEST=context.REQUEST\n
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
REQUEST=context.REQUEST\n
\n
# Add an object of the same type as the container\n
# or if allowed content types is 1 add that type\n
......@@ -77,7 +80,8 @@ except IndexError:\n
# return only a portal_status_message if the IndexError is raised because\n
# there are no elemnts in context.allowedContentTypes()\n
if not context.allowedContentTypes():\n
return REQUEST.RESPONSE.redirect(\'%s?portal_status_message=You are not allowed to add new content in this context.\' %context.absolute_url())\n
message = N_("You are not allowed to add new content in this context.")\n
return REQUEST.RESPONSE.redirect(\'%s?portal_status_message=%s\' % (context.absolute_url(), message))\n
else:\n
raise\n
url = new_object.absolute_url()\n
......@@ -126,9 +130,12 @@ return REQUEST.RESPONSE.redirect(url)\n
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>REQUEST</string>
<string>new_object</string>
<string>IndexError</string>
<string>message</string>
<string>url</string>
</tuple>
</value>
......
......@@ -66,12 +66,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
# make sure nothing is checked after\n
context.portal_selections.setSelectionCheckedUidsFor(selection_name, [])\n
\n
\n
REQUEST=context.REQUEST\n
# do we still need ids ? XXX finish the work here\n
#if REQUEST.has_key(\'ids\'):\n
......@@ -81,9 +83,11 @@ REQUEST=context.REQUEST\n
if uids != []:\n
#context.manage_cutObjects(uids=REQUEST[\'uids\'], REQUEST=REQUEST)\n
context.manage_cutObjects(uids=uids, REQUEST=REQUEST)\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=Item(s)+Cut.\')\n
message = N_("Item(s)+Cut.")\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n
else:\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/Folder_viewContentList?portal_status_message=Please+select+one+or+more+items+to+cut+first.\')\n
message = N_("Please+select+one+or+more+items+to+cut+first.")\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/Folder_viewContentList?portal_status_message=%s\' % message)\n
</string> </value>
</item>
<item>
......@@ -129,9 +133,12 @@ else:\n
<string>uids</string>
<string>listbox_uid</string>
<string>_getattr_</string>
<string>context</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>selected_uids</string>
<string>REQUEST</string>
<string>message</string>
</tuple>
</value>
</item>
......
......@@ -69,6 +69,9 @@
<value> <string encoding="cdata"><![CDATA[
from ZODB.POSException import ConflictError\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
\n
......@@ -94,7 +97,8 @@ def Object_hasRelation(object):\n
\n
ret_url = context.absolute_url() + \'/\' + form_id\n
if error:\n
qs = \'?portal_status_message=Sorry+your+selection+has+changed\'\n
message = N_("Sorry+your+selection+has+changed")\n
qs = \'?portal_status_message=%s\' % message\n
elif uids is not None:\n
# Check if there is some related objets.\n
object_used = 0\n
......@@ -103,19 +107,24 @@ elif uids is not None:\n
if Object_hasRelation(object):\n
object_used += 1\n
if object_used>0:\n
if object_used == 1: \n
qs = \'?portal_status_message=Sorry,+1+Item+Is+In+Use.\'\n
if object_used == 1:\n
message = N_("Sorry,+1+Item+Is+In+Use.")\n
qs = \'?portal_status_message=%s\' % message\n
else:\n
qs = \'?portal_status_message=Sorry,+%s+Items+Are+In+Use.\' % repr(object_used)\n
message = N_("Sorry,+${count}+Items+Are+In+Use.",\n
mapping={\'count\': repr(object_used)})\n
qs = \'?portal_status_message=%s\' % message \n
else:\n
try : \n
context.manage_delObjects(uids=uids, REQUEST=REQUEST)\n
qs = \'?portal_status_message=Deleted.\'\n
message = N_("Deleted.")\n
qs = \'?portal_status_message=%s\' % message\n
except ConflictError : raise\n
except Exception, message : \n
qs = \'?portal_status_message=%s\' % message\n
else:\n
qs = \'?portal_status_message=Please+select+one+or+more+items+first.\'\n
message = N_("Please+select+one+or+more+items+first.")\n
qs = \'?portal_status_message=%s\' % message\n
\n
return REQUEST.RESPONSE.redirect( ret_url + qs )\n
......@@ -173,12 +182,15 @@ return REQUEST.RESPONSE.redirect( ret_url + qs )\n
<string>ConflictError</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>selected_uids</string>
<string>error</string>
<string>REQUEST</string>
<string>qs</string>
<string>ret_url</string>
<string>Object_hasRelation</string>
<string>message</string>
<string>None</string>
<string>object_used</string>
<string>_getiter_</string>
......@@ -187,7 +199,6 @@ return REQUEST.RESPONSE.redirect( ret_url + qs )\n
<string>object</string>
<string>repr</string>
<string>Exception</string>
<string>message</string>
</tuple>
</value>
</item>
......
......@@ -72,14 +72,22 @@ if context.cb_dataValid:\n
# We first look if the content of objects to paste is allowed\n
# inside this folder\n
object_list = context.cb_dataItems()\n
portal_type_list = map(lambda x: x.getPortalType(),object_list)\n
allowed_type_list = map(lambda x: x.id, context.allowedContentTypes())\n
try:\n
portal_type_list = [x.getPortalType() for x in object_list]\n
except AttributeError:\n
error_message = \'Sorry+you+can+not+paste+theses+Items+here\'\n
else:\n
allowed_type_list = [x.id for x in context.allowedContentTypes()]\n
for portal_type in portal_type_list:\n
if portal_type not in allowed_type_list:\n
error_message = \'Sorry+you+can+not+paste+theses+Items+here\'\n
if context.cb_dataValid and error_message==\'\':\n
try:\n
new_item_list = context.manage_pasteObjects(REQUEST[\'__cp\'])\n
new_id_list = map(lambda i: i[\'new_id\'],new_item_list)\n
except KeyError:\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=Nothing+To+Paste.\')\n
else:\n
new_id_list = [i[\'new_id\'] for i in new_item_list]\n
for my_id in new_id_list:\n
context[my_id].flushActivity(invoke=0, method_id=\'immediateReindexObject\')\n
context[my_id].recursiveImmediateReindexObject()\n
......@@ -130,17 +138,22 @@ else:\n
<tuple>
<string>form_id</string>
<string>_getattr_</string>
<string>context</string>
<string>context</string>
<string>REQUEST</string>
<string>error_message</string>
<string>object_list</string>
<string>map</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>portal_type_list</string>
<string>AttributeError</string>
<string>allowed_type_list</string>
<string>_getiter_</string>
<string>portal_type</string>
<string>_getitem_</string>
<string>new_item_list</string>
<string>KeyError</string>
<string>i</string>
<string>new_id_list</string>
<string>my_id</string>
</tuple>
......
......@@ -68,7 +68,8 @@
<key> <string>_body</string> </key>
<value> <string>from Products.Formulator.Errors import ValidationError, FormValidationError\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
request=context.REQUEST\n
\n
try:\n
......@@ -100,9 +101,10 @@ try:\n
context,\n
kw[\'workflow_action\'],\n
**kw)\n
\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url(), form_id\n
, \'portal_status_message=Status+changed.\' )\n
message = N_(\'Status+changed.\')\n
redirect_url = \'%s/%s?portal_status_message=%s\' % ( \n
context.absolute_url(), form_id,\n
message)\n
\n
except FormValidationError, validation_errors:\n
# Pack errors into the request\n
......@@ -111,6 +113,7 @@ except FormValidationError, validation_errors:\n
return form(request)\n
\n
except ValidationFailed, error_message:\n
# I hope the error_message is already translated (if we need to use mapping)\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url(), form_id\n
, \'portal_status_message=%s\' % error_message\n
)\n
......@@ -165,6 +168,8 @@ context.REQUEST[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>ValidationFailed</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>request</string>
<string>getattr</string>
<string>form</string>
......@@ -183,6 +188,7 @@ context.REQUEST[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>listbox_line</string>
<string>tuple</string>
<string>_apply_</string>
<string>message</string>
<string>redirect_url</string>
<string>validation_errors</string>
<string>field_errors</string>
......
2006-03-03 Seb
* Commit Guillaume's fix to Resource_zGetTrackingList
2006-03-02 romain
* Correct Folder_paste.
2006-02-28 aurel
* add Domain Generator Method field in BaseDomain_view
* modify ERP5Site_reindexAll to reindex domains
......
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