<?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> <string encoding="base64">O/INCg==</string> </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>object_list = []\n
default_career = None\n
new_start_date = None\n
\n
# Create a list of all career line except the default one\n
for object in context.contentValues(filter={\'portal_type\':\'Career\'}):\n
  if object.getId() != \'default_career\':    \n
    object_list += [object]\n
  else:\n
    default_career = object\n
    new_start_date = default_career.getStopDate()\n
\n
# No default career\n
if default_career == None:\n
  return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'/Person_viewCareer?portal_status_message=Current+career+must+exist.\')\n
\n
# Inverse sort of the list by id\n
object_list.sort(lambda x, y: -cmp(int(x.getId()), int(y.getId())))\n
\n
# Shift all career lines id values\n
new_id = str(context.generateNewId())\n
for career_line in object_list:\n
  current_id = career_line.getId()\n
  context.manage_renameObject(current_id, new_id)\n
  new_id = current_id\n
\n
# Create a new default_career\n
context.manage_renameObject(\'default_career\', new_id)\n
new_default = context.manage_copyObjects(ids=(new_id,))\n
new_object = context.manage_pasteObjects(new_default)\n
context.manage_renameObject(new_object[0][\'new_id\'], \'default_career\')\n
context.setCareerStopDate(None)\n
context.setCareerStartDate(new_start_date)\n
\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'/Person_viewCareer?portal_status_message=Last+career+step+terminated.+New+career+step+added.\')\n
</string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAAAAAA8AAAATAAAAQwAA
AHMMAgAAZwAAfQAAdAEAfQIAdAEAfQMAeHEAdAQAdAUAdAYAZAEAgwIAZAIAaAAABGQDAGQEAAM8
gwABgwEARF1IAH0HAHQFAHwHAGQFAIMCAIMAAGQGAGoDAG8RAAF8AAB8BwBnAQA3fQAAcToAAXwH
AH0CAHQFAHwCAGQHAIMCAIMAAH0DAHE6AFd8AgB0AQBqAgBvOQABdAUAdAUAdAUAdAYAZAgAgwIA
ZAkAgwIAZAoAgwIAdAUAdAYAZAsAgwIAgwAAZAwAF4MBAFNuAQABdAUAfAAAZA0AgwIAZA4AhAAA
gwEAAXQIAHQFAHQGAGQPAIMCAIMAAIMBAH0JAHhCAHQEAHwAAIMBAERdNAB9CgB0BQB8CgBkBQCD
AgCDAAB9CwB0BQB0BgBkEACDAgB8CwB8CQCDAgABfAsAfQkAcQcBV3QFAHQGAGQQAIMCAGQGAHwJ
AIMCAAF0BQB0BgBkEQCDAgBkEgB8CQBmAQCDAAF9DAB0BQB0BgBkEwCDAgB8DACDAQB9DQB0BQB0
BgBkEACDAgB0DgB0DgB8DQBkFACDAgBkFQCDAgBkBgCDAgABdAUAdAYAZBYAgwIAdAEAgwEAAXQF
AHQGAG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ArdGVybWluYXRlZC4rTmV3K2NhcmVlcitz
dGVwK2FkZGVkLigPAAAAcwsAAABvYmplY3RfbGlzdHMEAAAATm9uZXMOAAAAZGVmYXVsdF9jYXJl
ZXJzDgAAAG5ld19zdGFydF9kYXRlcwkAAABfZ2V0aXRlcl9zCQAAAF9nZXRhdHRyX3MHAAAAY29u
dGV4dHMGAAAAb2JqZWN0cwMAAABzdHJzBgAAAG5ld19pZHMLAAAAY2FyZWVyX2xpbmVzCgAAAGN1
cnJlbnRfaWRzCwAAAG5ld19kZWZhdWx0cwoAAABuZXdfb2JqZWN0cwkAAABfZ2V0aXRlbV8oDwAA
AHMLAAAAb2JqZWN0X2xpc3RzBAAAAE5vbmVzDgAAAGRlZmF1bHRfY2FyZWVycw4AAABuZXdfc3Rh
cnRfZGF0ZXMJAAAAX2dldGl0ZXJfcwkAAABfZ2V0YXR0cl9zBwAAAGNvbnRleHRzBgAAAG9iamVj
dHMDAAAAc3RycwYAAABuZXdfaWRzCwAAAGNhcmVlcl9saW5lcwoAAABjdXJyZW50X2lkcwsAAABu
ZXdfZGVmYXVsdHMKAAAAbmV3X29iamVjdHMJAAAAX2dldGl0ZW1fKAAAAAAoAAAAAHMPAAAAU2Ny
aXB0IChQeXRob24pcxMAAABDYXJlZXJfc2hpZnREZWZhdWx0AQAAAHMwAAAABgEGAQYDKAAGARkB
EQIGARYDDQE8AxMDGAENAAYBFQETAQ0DEwEbARgBKAETARACKAEAAABzEwAAAENhcmVlcl9zaGlm
dERlZmF1bHQoAQAAAHMTAAAAQ2FyZWVyX3NoaWZ0RGVmYXVsdCgAAAAAKAAAAABzDwAAAFNjcmlw
dCAoUHl0aG9uKXMIAAAAPG1vZHVsZT4BAAAAcwAAAAA=</string> </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value> <string>Script (Python):/nexedi/portal_skins/erp5_core/Career_shiftDefault</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string></string> </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>object_list</string>
                            <string>None</string>
                            <string>default_career</string>
                            <string>new_start_date</string>
                            <string>_getiter_</string>
                            <string>_getattr_</string>
<string>context</string>
                            <string>object</string>
                            <string>str</string>
                            <string>new_id</string>
                            <string>career_line</string>
                            <string>current_id</string>
                            <string>new_default</string>
                            <string>new_object</string>
                            <string>_getitem_</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>Career_shiftDefault</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
