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
Labels
Merge Requests
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
e86a4433
Commit
e86a4433
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
9e85ed0b
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 @
e86a4433
...
@@ -62,14 +62,16 @@
...
@@ -62,14 +62,16 @@
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
var
gadget
=
this
,
action_info_list
=
[],
erp5_document
,
erp5_document
,
document_title
;
document_title
;
return
gadget
.
jio_get
(
options
.
jio_key
)
return
gadget
.
jio_get
(
options
.
jio_key
)
...
@@ -79,19 +81,45 @@
...
@@ -79,19 +81,45 @@
document_title
=
document
.
title
;
document_title
=
document
.
title
;
return
gadget
.
jio_allDocs
({
query
:
query
});
return
gadget
.
jio_allDocs
({
query
:
query
});
})
})
//TODO: build all action urls with corresponding action reference (ignore view, jio_view, etc)
.
push
(
function
(
action_list
)
{
.
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
)
{
.
push
(
function
(
action_document_list
)
{
var
url_for_parameter_list
=
[],
i
=
0
,
//TODO temporarily hardcoded
action_key
,
action_doc
;
var
action_list
=
[{
href
:
url
,
for
(
action_key
in
action_document_list
)
{
icon
:
null
,
action_doc
=
action_document_list
[
action_key
];
name
:
"
reply
"
,
url_for_parameter_list
.
push
({
command
:
'
change
'
,
options
:
{
page
:
"
ojs_controller
"
,
action
:
action_doc
.
reference
}});
title
:
"
Reply
"
}];
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
([
return
RSVP
.
all
([
renderLinkList
(
gadget
,
"
Views
"
,
"
eye
"
,
view_list
),
renderLinkList
(
gadget
,
"
Actions
"
,
"
gear
"
,
action_list
)
renderLinkList
(
gadget
,
"
Actions
"
,
"
gear
"
,
action_list
)
]);
]);
})
})
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
View file @
e86a4433
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1554
236282.64
</float>
<float>
1554
384682.86
</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