Commit dffd05c7 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Split skin folder in 2 for better organisation

slapos_crm_monitoring is the place to include alarms that search/adjust annomalies (ie.: Lack of contact, bad allocation definition ....)
parent 1f835cba
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>61.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_crm_monitoring</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -67,7 +67,7 @@ software_instance_list = context.portal_catalog(\n
group_by="specialise_uid"\n
)\n
\n
#Get the list of concerned Hosting Subscription reference\n
# Get the list of concerned Hosting Subscription reference\n
hs_reference_list = [si.getSpecialiseReference() for si in software_instance_list \n
if si.getSlapState() in [\'start_requested\', \'stop_requested\']\n
]\n
......
......@@ -57,8 +57,7 @@ portal = context.getPortalObject()\n
allocation_scope = computer.getAllocationScope()\n
computer_reference = computer.getReference()\n
\n
if allocation_scope != \'open/public\' and \\\n
allocation_scope != \'open/friend\':\n
if allocation_scope not in [\'open/public\', \'open/friend\']:\n
return\n
\n
is_service_provider = False\n
......@@ -80,7 +79,7 @@ if not is_service_provider:\n
\n
# Create a ticket (or re-open it) for this issue!\n
support_request = None\n
request_title = \'[MONITORING] Allocation scope has been changed for %s\' % computer_reference\n
request_title = \'We have changed allocation scope for %s\' % computer_reference\n
request_description = \'Allocation scope has been changed back to \' \\\n
\'open/personal for %s\' % computer_reference\n
\n
......@@ -106,26 +105,19 @@ if not is_service_provider:\n
return\n
\n
# Send notification message\n
message_title = \'We have changed allocation scope for %s\' % computer_reference\n
notification_reference = \'slapos-crm-computer_allocation_scope.notification\'\n
notification_message = portal.portal_notifications.getDocumentValue(\n
reference=notification_reference)\n
if notification_message is None:\n
message = """Dear user,\n
%s.\n
Do not hesitate to visit the web forum (http://community.slapos.org/forum) in case of question.\n
reference=\'slapos-crm-computer_allocation_scope.notification\')\n
\n
Regards,\n
\n
The slapos team""" % request_description\n
else:\n
if notification_message is not None:\n
mapping_dict = {\'computer_title\':computer.getTitle(),\n
\'computer_id\':computer_reference,\n
\'allocation_scope\':allocation_scope}\n
message = notification_message.asText(\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n
support_request.SupportRequest_trySendNotificationMessage(message_title,\n
else:\n
message = request_description\n
\n
support_request.SupportRequest_trySendNotificationMessage(request_title,\n
message, person.getRelativeUrl())\n
</string> </value>
</item>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -55,7 +55,7 @@
support_request = context\n
portal = context.getPortalObject()\n
\n
ressource = portal.service_module.slapos_crm_information.getRelativeUrl()\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
......@@ -71,7 +71,7 @@ event.edit(\n
title=message_title,\n
text_content=message,\n
start_date = DateTime(),\n
resource = ressource,\n
resource = resource,\n
source=source_relative_url,\n
follow_up=support_request.getRelativeUrl(),\n
)\n
......
44
\ No newline at end of file
45
\ No newline at end of file
slapos_crm
\ No newline at end of file
slapos_crm
slapos_crm_monitoring
\ 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