Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Richard
erp5
Commits
9d71f234
Commit
9d71f234
authored
Nov 06, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs] Add document redirect on edit new document
parent
7f44c447
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
158 deletions
+20
-158
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_html.html
...dule/gadget_officejs_erp5_page_ojs_add_document_html.html
+0
-8
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_html.xml
...odule/gadget_officejs_erp5_page_ojs_add_document_html.xml
+3
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_js.js
...e_module/gadget_officejs_erp5_page_ojs_add_document_js.js
+15
-145
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_js.xml
..._module/gadget_officejs_erp5_page_ojs_add_document_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_html.html
View file @
9d71f234
...
...
@@ -14,13 +14,5 @@
</head>
<body>
<form
class=
"save_form ui-body-c"
novalidate
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"
></button>
<div
data-gadget-url=
"gadget_erp5_form.html"
data-gadget-scope=
"form_view"
data-gadget-sandbox=
"public"
>
</div>
</form>
</body>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_html.xml
View file @
9d71f234
...
...
@@ -260,7 +260,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -274,7 +274,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.2051.42133.29593
</string>
</value>
<value>
<string>
96
3.7730.44194.2696
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>
150
1502796.71
</float>
<float>
150
9969877.35
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_js.js
View file @
9d71f234
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
RSVP
,
Blob
)
{
"
use strict
"
;
var
content_type
=
{
...
...
@@ -15,167 +15,37 @@
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
()
{
return
this
.
triggerSubmit
();
})
.
onEvent
(
'
submit
'
,
function
()
{
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
'
form_view
'
)
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
})
.
push
(
function
(
doc
)
{
doc
.
modification_date
=
(
new
Date
()).
toISOString
();
if
(
content_type
.
hasOwnProperty
(
doc
.
portal_type
))
{
doc
.
content_type
=
content_type
[
doc
.
portal_type
];
}
return
gadget
.
jio_post
(
doc
);
})
.
push
(
function
()
{
// Workaround, find a way to open document without break gadget.
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
page
"
:
"
ojs_document_list
"
}});
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
return
this
.
element
.
querySelector
(
'
button[type="submit"]
'
).
click
();
})
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
;
var
gadget
=
this
,
doc_id
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getDeclaredGadget
(
'
form_view
'
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
)
]);
})
.
push
(
function
(
result
)
{
return
result
[
0
].
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
my_title
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Title
"
,
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
title
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_reference
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Reference
"
,
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
reference
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_version
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Version
"
,
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
version
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_language
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Language
"
,
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
language
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_description
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Description
"
,
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
description
"
,
"
hidden
"
:
0
,
"
type
"
:
"
TextAreaField
"
},
"
my_portal_type
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Portal Type
"
,
"
default
"
:
result
[
1
],
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
portal_type
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_parent_relative_url
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Parent Relative Url
"
,
"
default
"
:
result
[
2
],
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
parent_relative_url
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_text_content
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Text Content
"
,
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
text_content
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
}
}},
"
_links
"
:
{
"
type
"
:
{
// form_list display portal_type in header
name
:
""
}
}
},
form_definition
:
{
group_list
:
[[
"
left
"
,
[[
"
my_title
"
],
[
"
my_reference
"
],
[
"
my_version
"
],
[
"
my_language
"
],
[
"
my_description
"
],
[
"
my_portal_type
"
],
[
"
my_parent_relative_url
"
]]
]]
}
return
gadget
.
jio_post
({
title
:
"
Untitled Document
"
,
portal_type
:
result
[
0
],
parent_relative_url
:
result
[
1
]
});
})
.
push
(
function
()
{
return
gadget
.
getSetting
(
'
document_title
'
);
})
.
push
(
function
(
document_title
)
{
return
gadget
.
updateHeader
({
page_title
:
"
New
"
+
document_title
,
save_action
:
true
.
push
(
function
(
id
)
{
return
gadget
.
redirect
({
command
:
'
display
'
,
options
:
{
jio_key
:
id
,
editable
:
true
}
});
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
Blob
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_js.xml
View file @
9d71f234
...
...
@@ -270,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
2.37203.11411.48349
</string>
</value>
<value>
<string>
96
3.17747.60005.26606
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
150
7206916
.7
</float>
<float>
150
9971879
.7
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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