Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.core
Commits
2a273d72
Commit
2a273d72
authored
Sep 13, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Send Mail on pending tickets
See merge request
!417
parents
0468138d
97ec74c4
Pipeline
#23487
failed with stage
in 0 seconds
Changes
24
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
3999 additions
and
25 deletions
+3999
-25
slapos_user_pending_ticket_report.xml
...portal_types/Person/slapos_user_pending_ticket_report.xml
+81
-0
slapos_crm_send_pending_ticket_reminder.xml
...portal_alarms/slapos_crm_send_pending_ticket_reminder.xml
+119
-0
Alarm_sendPendingTicketReminder.py
.../slapos_crm_monitoring/Alarm_sendPendingTicketReminder.py
+9
-0
Alarm_sendPendingTicketReminder.xml
...slapos_crm_monitoring/Alarm_sendPendingTicketReminder.xml
+62
-0
Person_getSlapOSPendingTicket.py
...ns/slapos_crm_monitoring/Person_getSlapOSPendingTicket.py
+19
-0
Person_getSlapOSPendingTicket.xml
...s/slapos_crm_monitoring/Person_getSlapOSPendingTicket.xml
+62
-0
Person_getSlapOSPendingTicketMessageTemplate.py
...onitoring/Person_getSlapOSPendingTicketMessageTemplate.py
+17
-0
Person_getSlapOSPendingTicketMessageTemplate.xml
...nitoring/Person_getSlapOSPendingTicketMessageTemplate.xml
+62
-0
Person_sendPendingTicketReminder.py
...slapos_crm_monitoring/Person_sendPendingTicketReminder.py
+8
-0
Person_sendPendingTicketReminder.xml
...lapos_crm_monitoring/Person_sendPendingTicketReminder.xml
+62
-0
Person_sendSlapOSPendingTicketNotification.py
..._monitoring/Person_sendSlapOSPendingTicketNotification.py
+27
-0
Person_sendSlapOSPendingTicketNotification.xml
...monitoring/Person_sendSlapOSPendingTicketNotification.xml
+62
-0
Person_viewSlapOSPendingTicketDialog.xml
...s_crm_monitoring/Person_viewSlapOSPendingTicketDialog.xml
+163
-0
listbox.xml
...nitoring/Person_viewSlapOSPendingTicketDialog/listbox.xml
+229
-0
listbox_delivery_start_date.xml
...SlapOSPendingTicketDialog/listbox_delivery_start_date.xml
+2386
-0
my_title.xml
...itoring/Person_viewSlapOSPendingTicketDialog/my_title.xml
+96
-0
your_response_event_text_content.xml
...SPendingTicketDialog/your_response_event_text_content.xml
+133
-0
your_response_event_title.xml
...ewSlapOSPendingTicketDialog/your_response_event_title.xml
+124
-0
test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+9
-0
test.erp5.testSlapOSCRMAlarm.xml
...teItem/portal_components/test.erp5.testSlapOSCRMAlarm.xml
+3
-24
test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+226
-1
template_action_path_list
master/bt5/slapos_crm/bt/template_action_path_list
+1
-0
ERP5Site_initSlapOSUITest.py
.../portal_skins/slapos_ui_test/ERP5Site_initSlapOSUITest.py
+38
-0
ERP5Site_initSlapOSUITest.xml
...portal_skins/slapos_ui_test/ERP5Site_initSlapOSUITest.xml
+1
-0
No files found.
master/bt5/slapos_crm/ActionTemplateItem/portal_types/Person/slapos_user_pending_ticket_report.xml
0 → 100644
View file @
2a273d72
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jio_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jio_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_user_pending_ticket_report
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
50.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Send Pending Ticket Report
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Person_viewSlapOSPendingTicketDialog
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_send_pending_ticket_reminder.xml
0 → 100644
View file @
2a273d72
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_sendPendingTicketReminder
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Send a Mail Message with a Reminder in case the user has Tickets to respond
</string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_crm_send_pending_ticket_reminder
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple>
<int>
6
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_hour_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple>
<int>
0
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1288051200.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_week_day
</string>
</key>
<value>
<tuple>
<string>
Tuesday
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
sense_method_id
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Check compute_node\'s state
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_sendPendingTicketReminder.py
0 → 100644
View file @
2a273d72
portal
=
context
.
getPortalObject
()
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Person'
,
method_id
=
'Person_sendPendingTicketReminder'
,
activate_kw
=
{
'tag'
:
tag
}
)
context
.
activate
(
after_tag
=
tag
)
.
getId
()
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_sendPendingTicketReminder.xml
0 → 100644
View file @
2a273d72
<?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>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_sendPendingTicketReminder
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_getSlapOSPendingTicket.py
0 → 100644
View file @
2a273d72
from
Products.ZSQLCatalog.SQLCatalog
import
ComplexQuery
,
SimpleQuery
portal
=
context
.
getPortalObject
()
person_uid
=
context
.
getUid
()
query
=
ComplexQuery
(
ComplexQuery
(
SimpleQuery
(
portal_type
=
[
"Support Request"
,
"Regularisation Request"
]),
SimpleQuery
(
simulation_state
=
"suspended"
),
SimpleQuery
(
destination_decision_uid
=
person_uid
),
logical_operator
=
'and'
),
ComplexQuery
(
SimpleQuery
(
portal_type
=
"Upgrade Decision"
),
SimpleQuery
(
simulation_state
=
"confirmed"
),
SimpleQuery
(
destination_decision_uid
=
person_uid
),
logical_operator
=
'and'
),
logical_operator
=
'or'
)
return
portal
.
portal_catalog
(
query
=
query
,
**
kw
)
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_getSlapOSPendingTicket.xml
0 → 100644
View file @
2a273d72
<?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>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_getSlapOSPendingTicket
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_getSlapOSPendingTicketMessageTemplate.py
0 → 100644
View file @
2a273d72
portal
=
context
.
getPortalObject
()
pending_ticket_list_amount
=
len
(
context
.
Person_getSlapOSPendingTicket
())
notification_message
=
portal
.
portal_notifications
.
getDocumentValue
(
reference
=
"slapos-crm-person-pending-ticket-notification"
)
if
notification_message
is
not
None
:
mapping_dict
=
{
'username'
:
context
.
getTitle
(),
'amount'
:
pending_ticket_list_amount
,
'website'
:
portal
.
portal_preferences
.
getPreferredSlaposWebSiteUrl
()}
return
notification_message
.
getTitle
(),
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
message
=
""" You have
%
s pending tickets """
%
pending_ticket_list_amount
return
message
,
message
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_getSlapOSPendingTicketMessageTemplate.xml
0 → 100644
View file @
2a273d72
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_getSlapOSPendingTicketMessageTemplate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_sendPendingTicketReminder.py
0 → 100644
View file @
2a273d72
amount
=
len
(
context
.
Person_getSlapOSPendingTicket
())
if
amount
>
0
:
title
,
reminder_message
=
context
.
Person_getSlapOSPendingTicketMessageTemplate
()
return
context
.
Person_sendSlapOSPendingTicketNotification
(
title
,
reminder_message
,
batch_mode
=
1
)
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_sendPendingTicketReminder.xml
0 → 100644
View file @
2a273d72
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_sendPendingTicketReminder
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_sendSlapOSPendingTicketNotification.py
0 → 100644
View file @
2a273d72
portal
=
context
.
getPortalObject
()
start_date
=
DateTime
()
# Rely on Trade condition (like in ticket to set the proper sender)
trade_condition
=
portal
.
sale_trade_condition_module
.
slapos_ticket_trade_condition
event_kw
=
{
'portal_type'
:
"Mail Message"
,
'title'
:
response_event_title
,
'resource'
:
"service_module/slapos_crm_information"
,
'source'
:
trade_condition
.
getSource
(),
'destination'
:
context
.
getRelativeUrl
(),
'start_date'
:
start_date
,
'text_content'
:
response_event_text_content
,
'content_type'
:
'text/plain'
,
}
# Create event
event
=
portal
.
event_module
.
newContent
(
**
event_kw
)
event
.
plan
()
event
.
start
(
send_mail
=
True
,
comment
=
"Sent via Person_sendSlapOSPendingTicketNotification"
)
if
batch_mode
:
return
event
message
=
portal
.
Base_translateString
(
'New event created.'
)
return
event
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
message
})
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_sendSlapOSPendingTicketNotification.xml
0 → 100644
View file @
2a273d72
<?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>
_params
</string>
</key>
<value>
<string>
response_event_title, response_event_text_content, batch_mode=False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_sendSlapOSPendingTicketNotification
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Person_viewSlapOSPendingTicketDialog.xml
0 → 100644
View file @
2a273d72
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
Person_sendSlapOSPendingTicketNotification
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>