Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Romain Courteaud
jio
Commits
f9bc827b
Commit
f9bc827b
authored
Mar 13, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5 taskman view post added
parent
94ae57fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
src/jio.storage/erp5storage.taskmanagerview.js
src/jio.storage/erp5storage.taskmanagerview.js
+41
-0
No files found.
src/jio.storage/erp5storage.taskmanagerview.js
View file @
f9bc827b
...
...
@@ -198,6 +198,47 @@
});
};
ERP5Storage
.
onView
.
taskmanager
.
post
=
function
(
metadata
,
options
)
{
var
final_response
;
return
ERP5Storage
.
getSiteDocument
(
this
.
_url
).
then
(
function
(
site_hal
)
{
/*jslint forin: true */
var
post_action
=
site_hal
.
_actions
.
add
,
data
=
new
FormData
();
data
.
append
(
"
portal_type
"
,
metadata
.
type
);
// for (key in metadata) {
// if (hasOwnProperty(metadata, key)) {
// // XXX Not a form dialog in this case but distant script
// data.append(key, metadata[key]);
// }
// }
return
jIO
.
util
.
ajax
({
"
type
"
:
post_action
.
method
,
"
url
"
:
post_action
.
href
,
"
data
"
:
data
,
"
xhrFields
"
:
{
withCredentials
:
true
}
});
}).
then
(
function
(
event
)
{
final_response
=
{
"
status
"
:
event
.
target
.
status
};
if
(
!
metadata
.
_id
)
{
// XXX Really depend on server response...
var
uri
=
new
URI
(
event
.
target
.
getResponseHeader
(
"
X-Location
"
));
final_response
.
id
=
uri
.
segment
(
2
);
metadata
.
_id
=
final_response
.
id
;
}
console
.
log
(
metadata
);
}).
then
(
ERP5Storage
.
onView
.
taskmanager
.
put
.
bind
(
this
,
metadata
,
options
)).
then
(
function
()
{
return
final_response
;
});
};
ERP5Storage
.
onView
.
taskmanager
.
put
=
function
(
metadata
,
options
)
{
return
getHatoas
.
call
(
this
,
metadata
,
options
).
then
(
function
(
event
)
{
...
...
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