Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roque
slapos.core
Commits
9d89f640
Commit
9d89f640
authored
Oct 07, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Inform user that his contract is disabled
He can access it or open a ticket.
parent
d9e55c3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
146 additions
and
117 deletions
+146
-117
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.js
...tem/web_page_module/rjs_gadget_erp5_attention_point_js.js
+16
-11
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.xml
...em/web_page_module/rjs_gadget_erp5_attention_point_js.xml
+108
-102
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py
...skins/slapos_hal_json_style/Base_getAttentionPointList.py
+22
-4
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.js
View file @
9d89f640
...
...
@@ -21,10 +21,16 @@
});
function
createAttentionPointTemplate
(
gadget
,
attention_point
)
{
if
(
attention_point
.
link
)
{
return
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
jio_key
:
attention_point
.
link
,
"
page
"
:
"
slap_controller
"
}})
var
page
=
"
slap_controller
"
,
option_dict
=
{};
if
(
attention_point
.
link
||
attention_point
.
page
)
{
if
(
attention_point
.
page
)
{
page
=
attention_point
.
page
;
}
option_dict
.
page
=
page
;
if
(
attention_point
.
link
)
{
option_dict
.
jio_key
=
attention_point
.
link
;
}
return
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
option_dict
})
.
push
(
function
(
link
)
{
return
gadget
.
translateHtml
(
attention_point_item_template
({
option
:
[{
...
...
@@ -33,14 +39,13 @@
}]
}));
});
}
else
{
return
gadget
.
translateHtml
(
attention_point_item_template
({
option
:
[{
text
:
attention_point
.
text
,
link
:
attention_point
.
link
}]
}));
}
return
gadget
.
translateHtml
(
attention_point_item_template
({
option
:
[{
text
:
attention_point
.
text
,
link
:
attention_point
.
link
}]
}));
}
gadget_klass
//////////////////////////////////////////////
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.xml
View file @
9d89f640
...
...
@@ -142,116 +142,122 @@
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1555594496.59
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1555594496.59
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.18542.14811.50363
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1556600431.66
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
987.9086.39006.59579
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1602096464.77
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py
View file @
9d89f640
...
...
@@ -2,6 +2,8 @@ from json import dumps
attention_point_list
=
[]
portal
=
context
.
getPortalObject
()
portal_type
=
context
.
getPortalType
()
def
addAttentionForTicket
(
ticket
):
msg
=
None
...
...
@@ -18,9 +20,8 @@ def addAttentionForTicket(ticket):
if
msg
:
return
{
"text"
:
msg
,
"link"
:
ticket
.
getRelativeUrl
()}
# Display unresponded tickets on services or servers
if
context
.
getPortalType
()
in
[
"Hosting Subscription"
,
"Computer"
]:
if
portal_type
in
[
"Hosting Subscription"
,
"Computer"
]:
simulation_state
=
[
"suspended"
,
"confirmed"
]
for
ticket
in
context
.
Base_getOpenRelatedTicketList
(
limit
=
3
,
simulation_state
=
simulation_state
):
...
...
@@ -30,7 +31,7 @@ if context.getPortalType() in ["Hosting Subscription", "Computer"]:
# This is a limitation of the API that will consider that all tickets
# Are from this module
if
context
.
getPortalType
()
in
[
"Support Request Module"
]:
if
portal_type
in
[
"Support Request Module"
]:
simulation_state
=
[
"suspended"
,
"confirmed"
]
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
for
ticket
in
portal
.
portal_catalog
(
...
...
@@ -41,5 +42,22 @@ if context.getPortalType() in ["Support Request Module"]:
entry
=
addAttentionForTicket
(
ticket
)
if
entry
is
not
None
:
attention_point_list
.
append
(
entry
)
if
portal_type
in
[
"Hosting Subscription Module"
,
"Hosting Subscription"
,
"Person"
]:
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
contract
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Cloud Contract"
,
default_destination_section_uid
=
person
.
getUid
(),
validation_state
=
[
'invalidated'
,
'validated'
],
)
if
contract
is
None
:
msg
=
context
.
Base_translateString
(
"Your Contract is Desactivated"
)
attention_point_list
.
append
({
"text"
:
msg
,
'page'
:
"slap_ticket_list"
})
elif
contract
.
getValidationState
()
==
"invalidated"
:
msg
=
context
.
Base_translateString
(
"Your Contract is Desactivated"
)
attention_point_list
.
append
({
"text"
:
msg
,
"link"
:
contract
.
getRelativeUrl
()})
return
dumps
(
attention_point_list
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment