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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
e2905847
Commit
e2905847
authored
Jun 17, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: allow uploading event's attachment
parent
672538f2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
186 additions
and
3 deletions
+186
-3
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_addSlapOSSupportRequest.py
...portal_skins/slapos_panel/Base_addSlapOSSupportRequest.py
+7
-1
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_addSlapOSSupportRequest.xml
...ortal_skins/slapos_panel/Base_addSlapOSSupportRequest.xml
+1
-1
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_viewSlapOSSupportRequestFastInputDialog.xml
...os_panel/Base_viewSlapOSSupportRequestFastInputDialog.xml
+1
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_viewSlapOSSupportRequestFastInputDialog/your_attachment.xml
...ewSlapOSSupportRequestFastInputDialog/your_attachment.xml
+84
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_addSlapOSEvent.py
...teItem/portal_skins/slapos_panel/Ticket_addSlapOSEvent.py
+7
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_addSlapOSEvent.xml
...eItem/portal_skins/slapos_panel/Ticket_addSlapOSEvent.xml
+1
-1
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_viewSlapOSEventFastInputDialog.xml
...ns/slapos_panel/Ticket_viewSlapOSEventFastInputDialog.xml
+1
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_viewSlapOSEventFastInputDialog/your_attachment.xml
...Ticket_viewSlapOSEventFastInputDialog/your_attachment.xml
+84
-0
No files found.
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_addSlapOSSupportRequest.py
View file @
e2905847
portal
=
context
.
getPortalObject
()
REQUEST
=
context
.
REQUEST
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
# Max ~3Mb
if
int
(
REQUEST
.
getHeader
(
'Content-Length'
,
0
))
>
3145728
:
REQUEST
.
RESPONSE
.
setStatus
(
413
)
return
""
if
context
.
getPortalType
()
==
'Project'
:
project
=
context
else
:
...
...
@@ -12,6 +18,6 @@ support_request = project.Project_createSupportRequestWithCausality(
destination_decision
=
person
.
getRelativeUrl
()
)
support_request
.
Ticket_addSlapOSEvent
(
title
,
description
,
resource
=
resource
,
batch
=
True
)
support_request
.
Ticket_addSlapOSEvent
(
title
,
description
,
attachment
=
attachment
,
resource
=
resource
,
batch
=
True
)
return
support_request
.
Base_redirect
()
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_addSlapOSSupportRequest.xml
View file @
e2905847
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
title, description, resource, **kw
</string>
</value>
<value>
<string>
title, description, resource,
attachment=None,
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_viewSlapOSSupportRequestFastInputDialog.xml
View file @
e2905847
...
...
@@ -91,6 +91,7 @@
<list>
<string>
your_title
</string>
<string>
your_description
</string>
<string>
your_attachment
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_viewSlapOSSupportRequestFastInputDialog/your_attachment.xml
0 → 100644
View file @
e2905847
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_attachment
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_file_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Attachment
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_addSlapOSEvent.py
View file @
e2905847
from
Products.ERP5Type.Errors
import
UnsupportedWorkflowMethod
REQUEST
=
context
.
REQUEST
portal
=
context
.
getPortalObject
()
ticket
=
context
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person_relative_url
=
person
.
getRelativeUrl
()
# Max ~3Mb
if
int
(
REQUEST
.
getHeader
(
'Content-Length'
,
0
))
>
3145728
:
REQUEST
.
RESPONSE
.
setStatus
(
413
)
return
""
if
person_relative_url
==
ticket
.
getDestination
():
direction
=
'incoming'
else
:
...
...
@@ -18,6 +24,7 @@ event = ticket.Ticket_createProjectEvent(
resource
,
text_content
=
text_content
,
content_type
=
'text/plain'
,
attachment
=
attachment
,
source
=
person_relative_url
)
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_addSlapOSEvent.xml
View file @
e2905847
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
title, text_content, batch=None, resource=None, **kw
</string>
</value>
<value>
<string>
title, text_content,
attachment=None,
batch=None, resource=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_viewSlapOSEventFastInputDialog.xml
View file @
e2905847
...
...
@@ -91,6 +91,7 @@
<list>
<string>
your_title
</string>
<string>
your_text_content
</string>
<string>
your_attachment
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Ticket_viewSlapOSEventFastInputDialog/your_attachment.xml
0 → 100644
View file @
e2905847
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_attachment
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_file_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Attachment
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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