Commit 9297edfc authored by Jérome Perrin's avatar Jérome Perrin

Redirect to current form_id and keep selection parameters in Person_shiftDefaultCareer

( + fix column ID in Person_viewDetails/listbox )

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15962 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f4cb267
...@@ -74,13 +74,16 @@ N_ = context.Base_translateString\n ...@@ -74,13 +74,16 @@ N_ = context.Base_translateString\n
person = context\n person = context\n
career_list = []\n career_list = []\n
\n \n
default_career = getattr(person, \'default_career\', None)\n default_career = None\n
\n if \'default_career\' in person.objectIds():\n
default_career = person[\'default_career\']\n
\n \n
if default_career is None:\n if default_career is None:\n
# No default career.\n # No default career.\n
message = N_(\'Current career must exist.\')\n message = N_(\'Current career must exist.\')\n
return context.Base_redirect(form_id=\'Person_viewCareer\',\n return context.Base_redirect(form_id=form_id,\n
selection_name=selection_name,\n
selection_index=selection_index,\n
keep_items={\'portal_status_message\': message})\n keep_items={\'portal_status_message\': message})\n
else:\n else:\n
# Copy and paste the default career.\n # Copy and paste the default career.\n
...@@ -90,7 +93,9 @@ else:\n ...@@ -90,7 +93,9 @@ else:\n
default_career.setId(new_id)\n default_career.setId(new_id)\n
except ActivityPendingError, error:\n except ActivityPendingError, error:\n
message = N_("%s" % error)\n message = N_("%s" % error)\n
return context.Base_redirect(form_id=\'Person_viewCareer\',\n return context.Base_redirect(form_id=form_id,\n
selection_name=selection_name,\n
selection_index=selection_index,\n
keep_items={\'portal_status_message\': message})\n keep_items={\'portal_status_message\': message})\n
\n \n
new_start_date = default_career.getStopDate()\n new_start_date = default_career.getStopDate()\n
...@@ -106,7 +111,9 @@ else:\n ...@@ -106,7 +111,9 @@ else:\n
stop_date=None)\n stop_date=None)\n
\n \n
message = N_(\'Last career step terminated. New career step added.\')\n message = N_(\'Last career step terminated. New career step added.\')\n
return context.Base_redirect(form_id=\'Person_viewCareer\',\n return context.Base_redirect(form_id=form_id,\n
selection_name=selection_name,\n
selection_index=selection_index,\n
keep_items={\'portal_status_message\': message})\n keep_items={\'portal_status_message\': message})\n
</string> </value> </string> </value>
</item> </item>
...@@ -130,7 +137,7 @@ else:\n ...@@ -130,7 +137,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>selection_name=\'\', selection_index=\'0\', form_id=\'view\'</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -150,12 +157,15 @@ else:\n ...@@ -150,12 +157,15 @@ else:\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>3</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>selection_name</string>
<string>selection_index</string>
<string>form_id</string>
<string>Products.CMFActivity.Errors</string> <string>Products.CMFActivity.Errors</string>
<string>ActivityPendingError</string> <string>ActivityPendingError</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -163,16 +173,16 @@ else:\n ...@@ -163,16 +173,16 @@ else:\n
<string>N_</string> <string>N_</string>
<string>person</string> <string>person</string>
<string>career_list</string> <string>career_list</string>
<string>getattr</string>
<string>None</string> <string>None</string>
<string>default_career</string> <string>default_career</string>
<string>_getitem_</string>
<string>message</string> <string>message</string>
<string>new_id</string> <string>new_id</string>
<string>error</string> <string>error</string>
<string>new_start_date</string> <string>new_start_date</string>
<string>cb_data</string> <string>cb_data</string>
<string>copied</string> <string>copied</string>
<string>_getitem_</string> <string>getattr</string>
<string>new_default_career</string> <string>new_default_career</string>
</tuple> </tuple>
</value> </value>
...@@ -185,7 +195,11 @@ else:\n ...@@ -185,7 +195,11 @@ else:\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<string></string>
<string>0</string>
<string>view</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -123,8 +123,8 @@ ...@@ -123,8 +123,8 @@
<string>Career End Date</string> <string>Career End Date</string>
</tuple> </tuple>
<tuple> <tuple>
<string>Base_getTranslatedId</string> <string>translated_id</string>
<string>Career function</string> <string>Career Function</string>
</tuple> </tuple>
<tuple> <tuple>
<string>state_title</string> <string>state_title</string>
......
173 174
\ No newline at end of file \ No newline at end of file
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