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
1a64a95e
Commit
1a64a95e
authored
Apr 24, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: refactor on form view gadget and new common utils gadget
parent
bdc37f33
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
831 additions
and
56 deletions
+831
-56
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_html.html
...em/web_page_module/gadget_officejs_common_utils_html.html
+18
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_html.xml
...tem/web_page_module/gadget_officejs_common_utils_html.xml
+363
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
...teItem/web_page_module/gadget_officejs_common_utils_js.js
+65
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.xml
...eItem/web_page_module/gadget_officejs_common_utils_js.xml
+359
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+10
-5
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
..._module/gadget_officejs_controller_page_controller_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+4
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_html.html
...eItem/web_page_module/gadget_officejs_form_view_html.html
+1
-1
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_html.xml
...teItem/web_page_module/gadget_officejs_form_view_html.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.js
...plateItem/web_page_module/gadget_officejs_form_view_js.js
+0
-38
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.xml
...lateItem/web_page_module/gadget_officejs_form_view_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
.../web_page_module/gadget_officejs_page_handle_action_js.js
+3
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
...web_page_module/gadget_officejs_page_handle_action_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_html.html
0 → 100644
View file @
1a64a95e
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Common Utils
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_officejs_common_utils.js"
></script>
</head>
<body>
</body>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_html.xml
0 → 100644
View file @
1a64a95e
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
0 → 100644
View file @
1a64a95e
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
document
,
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
isDesktopMedia
"
,
"
isDesktopMedia
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_put
"
,
"
jio_put
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
'
notifySubmitted
'
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
createDocument
"
,
function
(
options
)
{
var
gadget
=
this
,
doc
=
{
title
:
"
Untitled Document
"
,
portal_type
:
options
.
portal_type
,
parent_relative_url
:
options
.
parent_relative_url
},
key
,
doc_key
;
for
(
key
in
options
)
{
if
(
options
.
hasOwnProperty
(
key
))
{
if
(
key
.
startsWith
(
"
my_
"
))
{
doc_key
=
key
.
replace
(
"
my_
"
,
""
);
doc
[
doc_key
]
=
options
[
key
];
}
}
}
return
gadget
.
jio_post
(
doc
);
})
.
declareMethod
(
"
getFormDefinition
"
,
function
(
portal_type
,
action_reference
)
{
var
gadget
=
this
,
parent
=
"
portal_types/
"
+
portal_type
,
query
=
'
portal_type: "Action Information" AND reference: "
'
+
action_reference
+
'
" AND parent_relative_url: "
'
+
parent
+
'
"
'
;
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
data
)
{
if
(
data
.
data
.
rows
.
length
===
0
)
{
throw
"
Can not find action '
"
+
action_reference
+
"
' for portal type '
"
+
portal_type
+
"
'
"
;
}
return
gadget
.
jio_get
(
data
.
data
.
rows
[
0
].
id
);
})
.
push
(
function
(
action_result
)
{
return
gadget
.
jio_get
(
action_result
.
action
);
})
.
push
(
function
(
form_result
)
{
return
form_result
.
form_definition
;
});
});
}(
document
,
window
,
rJS
,
RSVP
));
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.xml
0 → 100644
View file @
1a64a95e
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
View file @
1a64a95e
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
"
use strict
"
;
"
use strict
"
;
var
default_view
=
"
jio_view
"
,
var
default_view
=
"
jio_view
"
,
gadget_utils
;
common_utils_gadget_url
=
"
gadget_officejs_common_utils.html
"
,
form_view_gadget_url
=
"
gadget_officejs_form_view.html
"
,
child_gadget_url
=
'
gadget_erp5_pt_form_view_editable.html
'
;
rJS
(
window
)
rJS
(
window
)
...
@@ -30,9 +32,8 @@
...
@@ -30,9 +32,8 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
var
gadget
=
this
,
child_gadget_url
=
'
gadget_erp5_pt_form_view_editable.html
'
,
gadget_utils
,
jio_document
;
jio_document
;
return
gadget
.
declareGadget
(
common_utils_gadget_url
)
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
gadget_utils
=
result
;
gadget_utils
=
result
;
return
gadget
.
jio_get
(
options
.
jio_key
);
return
gadget
.
jio_get
(
options
.
jio_key
);
...
@@ -61,7 +62,11 @@
...
@@ -61,7 +62,11 @@
})
})
.
onStateChange
(
function
()
{
.
onStateChange
(
function
()
{
return
gadget_utils
.
renderGadget
(
this
);
var
gadget
=
this
;
return
gadget
.
declareGadget
(
form_view_gadget_url
)
.
push
(
function
(
form_view_gadget
)
{
return
form_view_gadget
.
renderGadget
(
gadget
);
});
});
});
}(
window
,
rJS
));
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
1a64a95e
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.
9054.53655.8977
</string>
</value>
<value>
<string>
975.
16183.49695.48503
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -243,7 +243,7 @@
...
@@ -243,7 +243,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155
5685699.99
</float>
<float>
155
6115863.74
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
1a64a95e
...
@@ -233,6 +233,8 @@ gadget_field_new_action_js_script.html\n
...
@@ -233,6 +233,8 @@ gadget_field_new_action_js_script.html\n
gadget_field_new_action_js_script.js\n
gadget_field_new_action_js_script.js\n
gadget_field_reply_action_js_script.html\n
gadget_field_reply_action_js_script.html\n
gadget_field_reply_action_js_script.js\n
gadget_field_reply_action_js_script.js\n
gadget_officejs_common_utils.html\n
gadget_officejs_common_utils.js\n
\n
\n
#needed for appcachestorage sync\n
#needed for appcachestorage sync\n
/\n
/\n
...
@@ -742,7 +744,7 @@ NETWORK:\n
...
@@ -742,7 +744,7 @@ NETWORK:\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.1
5178.25005.32409
</string>
</value>
<value>
<string>
975.1
6181.55679.14097
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -760,7 +762,7 @@ NETWORK:\n
...
@@ -760,7 +762,7 @@ NETWORK:\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1556
053135.7
</float>
<float>
1556
114650.11
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_html.html
View file @
1a64a95e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS
Common Utils
</title>
<title>
OfficeJS
Form View
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"renderjs.js"
></script>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_html.xml
View file @
1a64a95e
...
@@ -273,7 +273,7 @@
...
@@ -273,7 +273,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.7931.
7412.49851
</string>
</value>
<value>
<string>
975.7931.
26448.43366
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -291,7 +291,7 @@
...
@@ -291,7 +291,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155
5618284.2
</float>
<float>
155
6112021.33
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.js
View file @
1a64a95e
...
@@ -61,44 +61,6 @@
...
@@ -61,44 +61,6 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
createDocument
"
,
function
(
options
)
{
var
gadget
=
this
,
doc
=
{
title
:
"
Untitled Document
"
,
portal_type
:
options
.
portal_type
,
parent_relative_url
:
options
.
parent_relative_url
},
key
,
doc_key
;
for
(
key
in
options
)
{
if
(
options
.
hasOwnProperty
(
key
))
{
if
(
key
.
startsWith
(
"
my_
"
))
{
doc_key
=
key
.
replace
(
"
my_
"
,
""
);
doc
[
doc_key
]
=
options
[
key
];
}
}
}
return
gadget
.
jio_post
(
doc
);
})
.
declareMethod
(
"
getFormDefinition
"
,
function
(
portal_type
,
action_reference
)
{
var
gadget
=
this
,
parent
=
"
portal_types/
"
+
portal_type
,
query
=
'
portal_type: "Action Information" AND reference: "
'
+
action_reference
+
'
" AND parent_relative_url: "
'
+
parent
+
'
"
'
;
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
data
)
{
if
(
data
.
data
.
rows
.
length
===
0
)
{
throw
"
Can not find action '
"
+
action_reference
+
"
' for portal type '
"
+
portal_type
+
"
'
"
;
}
return
gadget
.
jio_get
(
data
.
data
.
rows
[
0
].
id
);
})
.
push
(
function
(
action_result
)
{
return
gadget
.
jio_get
(
action_result
.
action
);
})
.
push
(
function
(
form_result
)
{
return
form_result
.
form_definition
;
});
})
.
declareMethod
(
"
renderForm
"
,
function
(
form_definition
,
document
)
{
.
declareMethod
(
"
renderForm
"
,
function
(
form_definition
,
document
)
{
var
i
,
j
,
fields
,
field_info
,
my_element
,
element_id
,
rendered_field
,
var
i
,
j
,
fields
,
field_info
,
my_element
,
element_id
,
rendered_field
,
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.xml
View file @
1a64a95e
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.
9052.17383.43895
</string>
</value>
<value>
<string>
975.
16184.31473.12014
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155
5685570.38
</float>
<float>
155
6114597.52
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
View file @
1a64a95e
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
(
function
(
window
,
document
,
rJS
,
RSVP
)
{
(
function
(
window
,
document
,
rJS
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
var
gadget_utils
,
action_reference
,
action_type
,
action_gadget
;
var
common_utils_gadget_url
=
"
gadget_officejs_common_utils.html
"
,
gadget_utils
,
action_reference
,
action_type
,
action_gadget
;
rJS
(
window
)
rJS
(
window
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -32,7 +33,7 @@
...
@@ -32,7 +33,7 @@
gadget
.
getUrlParameter
(
"
action_type
"
),
gadget
.
getUrlParameter
(
"
action_type
"
),
gadget
.
getUrlParameter
(
"
parent_portal_type
"
),
gadget
.
getUrlParameter
(
"
parent_portal_type
"
),
gadget
.
getSetting
(
'
parent_portal_type
'
),
gadget
.
getSetting
(
'
parent_portal_type
'
),
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
)
gadget
.
declareGadget
(
common_utils_gadget_url
)
]);
]);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
View file @
1a64a95e
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.161
39.11100.7901
</string>
</value>
<value>
<string>
975.161
80.59466.25548
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155611
1042.1
8
</float>
<float>
155611
3276.2
8
</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