Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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 @@
...
@@ -14,13 +14,5 @@
</head>
</head>
<body>
<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>
</body>
</html>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_html.xml
View file @
9d71f234
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -274,7 +274,7 @@
...
@@ -274,7 +274,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -292,7 +292,7 @@
...
@@ -292,7 +292,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
150
1502796.71
</float>
<float>
150
9969877.35
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_js.js
View file @
9d71f234
/*global window, rJS, RSVP */
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
RSVP
,
Blob
)
{
"
use strict
"
;
"
use strict
"
;
var
content_type
=
{
var
content_type
=
{
...
@@ -15,167 +15,37 @@
...
@@ -15,167 +15,37 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// 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
()
{
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
;
var
gadget
=
this
,
doc_id
;
return
RSVP
.
Queue
()
return
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
RSVP
.
all
([
gadget
.
getDeclaredGadget
(
'
form_view
'
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
)
gadget
.
getSetting
(
'
parent_relative_url
'
)
]);
]);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
return
result
[
0
].
render
({
return
gadget
.
jio_post
({
erp5_document
:
{
title
:
"
Untitled Document
"
,
"
_embedded
"
:
{
"
_view
"
:
{
portal_type
:
result
[
0
],
"
my_title
"
:
{
parent_relative_url
:
result
[
1
]
"
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
"
]]
]]
}
});
});
})
})
.
push
(
function
()
{
.
push
(
function
(
id
)
{
return
gadget
.
getSetting
(
'
document_title
'
);
return
gadget
.
redirect
({
})
command
:
'
display
'
,
.
push
(
function
(
document_title
)
{
options
:
{
return
gadget
.
updateHeader
({
jio_key
:
id
,
page_title
:
"
New
"
+
document_title
,
editable
:
true
save_action
:
true
}
});
});
});
});
});
});
}(
window
,
rJS
,
RSVP
));
}(
window
,
rJS
,
RSVP
,
Blob
));
\ No newline at end of file
\ 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 @@
...
@@ -270,7 +270,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -288,7 +288,7 @@
...
@@ -288,7 +288,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
150
7206916
.7
</float>
<float>
150
9971879
.7
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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