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
1
Issues
1
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
Roque
erp5
Commits
70c581cb
Commit
70c581cb
authored
Apr 04, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: action page offline handles all document actions
parent
57ce5d6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
13 deletions
+41
-13
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.js
...web_page_module/gadget_officejs_page_action_offline_js.js
+39
-11
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
...eb_page_module/gadget_officejs_page_action_offline_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.js
View file @
70c581cb
...
...
@@ -62,14 +62,16 @@
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
action_info_list
=
[],
erp5_document
,
document_title
;
return
gadget
.
jio_get
(
options
.
jio_key
)
...
...
@@ -79,19 +81,45 @@
document_title
=
document
.
title
;
return
gadget
.
jio_allDocs
({
query
:
query
});
})
//TODO: build all action urls with corresponding action reference (ignore view, jio_view, etc)
.
push
(
function
(
action_list
)
{
return
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
ojs_controller
"
,
action
:
"
reply
"
}});
var
path_for_jio_get_list
=
[],
row
;
for
(
row
in
action_list
.
data
.
rows
)
{
if
(
action_list
.
data
.
rows
.
hasOwnProperty
(
row
))
{
path_for_jio_get_list
.
push
(
gadget
.
jio_get
(
action_list
.
data
.
rows
[
row
].
id
));
}
}
return
RSVP
.
all
(
path_for_jio_get_list
);
})
.
push
(
function
(
url
)
{
//TODO temporarily hardcoded
var
action_list
=
[{
href
:
url
,
icon
:
null
,
name
:
"
reply
"
,
title
:
"
Reply
"
}];
.
push
(
function
(
action_document_list
)
{
var
url_for_parameter_list
=
[],
i
=
0
,
action_key
,
action_doc
;
for
(
action_key
in
action_document_list
)
{
action_doc
=
action_document_list
[
action_key
];
url_for_parameter_list
.
push
({
command
:
'
change
'
,
options
:
{
page
:
"
ojs_controller
"
,
action
:
action_doc
.
reference
}});
action_info_list
[
i
]
=
{
reference
:
action_doc
.
reference
,
title
:
action_doc
.
title
};
i
+=
1
;
}
return
gadget
.
getUrlForList
(
url_for_parameter_list
);
})
.
push
(
function
(
url_list
)
{
var
action_list
=
[],
view_list
=
[],
url
,
i
,
element
;
for
(
i
=
0
;
i
<
url_list
.
length
;
i
+=
1
)
{
element
=
{
href
:
url_list
[
i
],
icon
:
null
,
name
:
action_info_list
[
i
].
reference
,
title
:
action_info_list
[
i
].
title
};
// TODO: maybe both view and jio_view should be ignored here
if
(
element
.
name
!=
"
view
"
)
{
if
(
element
.
name
==
"
jio_view
"
)
{
view_list
.
push
(
element
);
}
else
{
action_list
.
push
(
element
);
}
}
}
// TODO: check other lists like clone or delete?
return
RSVP
.
all
([
renderLinkList
(
gadget
,
"
Views
"
,
"
eye
"
,
view_list
),
renderLinkList
(
gadget
,
"
Actions
"
,
"
gear
"
,
action_list
)
]);
})
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
View file @
70c581cb
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.5
0433.27422.11178
</string>
</value>
<value>
<string>
974.5
2897.57392.44646
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1554
236282.64
</float>
<float>
1554
384682.86
</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