<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </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 encoding="cdata"><![CDATA[

support_request = context\n
portal = context.getPortalObject()\n
\n
resource = portal.service_module.slapos_crm_information.getRelativeUrl()\n
# create Web message if needed for this ticket\n
last_event = context.portal_catalog.getResultValue(\n
             follow_up_uid=support_request.getUid(), \n
             sort_on=[(\'delivery.start_date\', \'DESC\')],\n
)\n
if last_event and (interval_of_day > 0) and \\\n
    (DateTime() - last_event.getStartDate()  < interval_of_day):\n
  # User has already been notified this last 24h.\n
  return\n
event = portal.event_module.slapos_crm_web_message_template.\\\n
  Base_createCloneDocument(batch_mode=1)\n
event.edit(\n
  title=message_title,\n
  text_content=message,\n
  start_date = DateTime(),\n
  resource = resource,\n
  source=source_relative_url,\n
  follow_up=support_request.getRelativeUrl(),\n
)\n
event.stop()\n
event.deliver()\n
\n
return event\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>message_title, message, source_relative_url, interval_of_day=1</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>SupportRequest_trySendNotificationMessage</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
