Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
183d09a0
Commit
183d09a0
authored
Jan 23, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing actions for tickets. missing ERP5 handlers
parent
d3b66663
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
js/erp5_loader.js
js/erp5_loader.js
+56
-0
No files found.
js/erp5_loader.js
View file @
183d09a0
...
...
@@ -1533,6 +1533,62 @@
storage
.
add
(
obj
);
},
/**
* Start a software instance
* @method start_instance
* @param {object} obj Action Object
**/
"
update_ticket
"
:
function
(
obj
)
{
var
element
=
obj
.
element
,
formData
,
valid
,
replace
,
property
,
value
,
id
,
decode
;
id
=
obj
.
state
.
fragment_list
[
1
];
formData
=
new
FormData
();
valid
=
storage
.
validate
(
obj
.
gadget
);
decode
=
/^
[^\/]
*%2
[^\/]
*$/
.
test
(
id
);
if
(
valid
===
undefined
)
{
util
.
loader
(
""
,
"
validation_dict.general
"
,
"
ban-circle
"
);
// form is valid and not "spam"
}
else
{
replace
=
obj
.
gadget
.
id
+
"
_
"
;
for
(
property
in
valid
)
{
if
(
valid
.
hasOwnProperty
(
property
))
{
value
=
valid
[
property
];
// prepare to store
// TODO: add id to captcha fields missing it...
if
(
property
!==
"
undefined
"
)
{
if
(
property
!==
"
identifier
"
)
{
formData
.
append
(
property
.
replace
(
replace
,
""
),
value
);
}
}
}
}
util
.
loader
(
""
,
"
status_dict.updating
"
);
storage
[
"
items
"
].
get
({
"
_id
"
:
obj
.
state
.
fragment_list
[
1
]},{
"
_view
"
:
"
web_view
"
})
.
then
(
function
(
response
)
{
return
jIO
.
util
.
ajax
({
"
url
"
:
util
.
parse
(
response
).
data
.
_actions
.
update_allocation_scope
.
href
,
"
type
"
:
"
POST
"
,
"
data
"
:
formData
});
})
.
then
(
function
(
answer
)
{
util
.
loader
(
""
,
"
status_dict.success
"
,
"
check
"
);
$
.
mobile
.
changePage
(
"
#services
"
);
})
.
fail
(
function
(
error
)
{
util
.
error
(
error
);
if
(
util
.
parse
(
error
.
target
).
responseText
===
""
&&
id
&&
obj
.
state
.
callback
)
{
$
.
mobile
.
changePage
(
obj
.
state
.
callback
.
replace
(
"
__id__
"
,
decode
?
id
:
window
.
encodeURIComponent
(
id
)));
}
});
}
},
/**
* Add a server
* @method submit
...
...
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