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
c7a632f1
Commit
c7a632f1
authored
May 10, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: removing hardcoded values and refactoring
parent
776fe66e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
60 deletions
+29
-60
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
...teItem/web_page_module/gadget_officejs_common_utils_js.js
+0
-34
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.xml
...eItem/web_page_module/gadget_officejs_common_utils_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+13
-0
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_page_action_officejs_js.js
...eb_page_module/gadget_officejs_page_action_officejs_js.js
+1
-8
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
...b_page_module/gadget_officejs_page_action_officejs_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
+7
-10
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_js.js
View file @
c7a632f1
...
@@ -51,26 +51,6 @@
...
@@ -51,26 +51,6 @@
return
[
form_type
,
child_gadget_url
];
return
[
form_type
,
child_gadget_url
];
})
})
.
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
(
"
checkMoreActions
"
,
function
(
portal_type
,
action_category
)
{
.
declareMethod
(
"
checkMoreActions
"
,
function
(
portal_type
,
action_category
)
{
var
gadget
=
this
,
var
gadget
=
this
,
has_more_dict
=
{
views
:
{},
actions
:
{}},
has_more_dict
=
{
views
:
{},
actions
:
{}},
...
@@ -133,20 +113,6 @@
...
@@ -133,20 +113,6 @@
//view and actions are managed by same actions-gadget-page
//view and actions are managed by same actions-gadget-page
form_definition
.
has_more_views
=
false
;
form_definition
.
has_more_views
=
false
;
form_definition
.
has_more_actions
=
has_more_dict
.
has_more_actions
;
form_definition
.
has_more_actions
=
has_more_dict
.
has_more_actions
;
//for backward compatibility (header add button - '+' icon)
if
(
form_definition
.
action_type
===
"
object_list
"
)
{
form_definition
.
_links
.
action_object_new_content_action
=
{
page
:
"
handle_action
"
,
title
:
"
New Post
"
,
action
:
"
new_html_post
"
,
reference
:
"
new_html_post
"
,
action_type
:
"
object_jio_js_script
"
,
parent_portal_type
:
"
Post Module
"
,
portal_type
:
"
HTML Post
"
,
source_reference
:
source_reference
};
//form_definition.has_more_actions = false;
}
return
form_definition
;
return
form_definition
;
});
});
});
});
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.xml
View file @
c7a632f1
...
@@ -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.
39673.49091.1095
6
</string>
</value>
<value>
<string>
975.
40669.15893.694
6
</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>
15574
36563.26
</float>
<float>
15574
96163.64
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
View file @
c7a632f1
...
@@ -61,6 +61,19 @@
...
@@ -61,6 +61,19 @@
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
form_definition
=
result
;
form_definition
=
result
;
//TODO: solve add button
//for backward compatibility (header add button - '+' icon)
if
(
form_definition
.
action_type
===
"
object_list
"
)
{
form_definition
.
_links
.
action_object_new_content_action
=
{
page
:
"
handle_action
"
,
title
:
"
New Post
"
,
action
:
"
new_html_post
"
,
reference
:
"
new_html_post
"
,
action_type
:
"
object_jio_js_script
"
,
parent_portal_type
:
"
Post Module
"
,
source_reference
:
"
for-future-thread-id
"
};
}
return
gadget_utils
.
getFormInfo
(
form_definition
);
return
gadget_utils
.
getFormInfo
(
form_definition
);
})
})
.
push
(
function
(
form_info
)
{
.
push
(
function
(
form_info
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
c7a632f1
...
@@ -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.
39691.34802.60091
</string>
</value>
<value>
<string>
975.
40671.20077.18653
</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>
15574
37553.02
</float>
<float>
15574
96397.35
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
View file @
c7a632f1
...
@@ -106,20 +106,13 @@
...
@@ -106,20 +106,13 @@
if
(
view_categories
.
includes
(
action_doc
.
action_type
))
{
if
(
view_categories
.
includes
(
action_doc
.
action_type
))
{
page
=
"
ojs_controller
"
;
page
=
"
ojs_controller
"
;
}
}
//TODO (how to get child portal type?)
//'parent' and 'child' portal_types will be in the custom code of action gadgets
var
child_portal_type
=
portal_type
;
if
(
action_doc
.
reference
===
"
new_html_post
"
)
{
child_portal_type
=
"
HTML Post
"
;
}
action_settings_list
.
push
({
action_settings_list
.
push
({
page
:
page
,
page
:
page
,
title
:
action_doc
.
title
,
title
:
action_doc
.
title
,
action
:
action_doc
.
reference
,
action
:
action_doc
.
reference
,
reference
:
action_doc
.
reference
,
reference
:
action_doc
.
reference
,
action_type
:
action_doc
.
action_type
,
action_type
:
action_doc
.
action_type
,
parent_portal_type
:
portal_type
,
parent_portal_type
:
portal_type
portal_type
:
child_portal_type
});
});
}
}
}
}
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
View file @
c7a632f1
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.39
646.60719.8601
</string>
</value>
<value>
<string>
975.39
736.64982.14762
</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>
15574
36194.5
</float>
<float>
15574
89660.39
</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 @
c7a632f1
...
@@ -24,13 +24,12 @@
...
@@ -24,13 +24,12 @@
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
RSVP
.
all
([
gadget
.
getUrlParameter
(
"
parent_portal_type
"
),
gadget
.
getUrlParameter
(
"
parent_portal_type
"
),
gadget
.
getSetting
(
'
parent_portal_type
'
),
gadget
.
declareGadget
(
"
gadget_officejs_common_utils.html
"
)
gadget
.
declareGadget
(
"
gadget_officejs_common_utils.html
"
)
]);
]);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
parent_portal_type
=
result
[
0
]
||
result
[
1
]
;
parent_portal_type
=
result
[
0
];
return
result
[
2
].
getFormDefinition
(
parent_portal_type
,
action_reference
);
return
result
[
1
].
getFormDefinition
(
parent_portal_type
,
action_reference
);
});
});
})
})
...
@@ -41,17 +40,15 @@
...
@@ -41,17 +40,15 @@
return
RSVP
.
all
([
return
RSVP
.
all
([
gadget
.
getUrlParameter
(
'
portal_type
'
),
gadget
.
getUrlParameter
(
'
portal_type
'
),
gadget
.
getUrlParameter
(
'
parent_relative_url
'
),
gadget
.
getUrlParameter
(
'
parent_relative_url
'
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
),
gadget
.
getUrlParameter
(
"
action
"
),
gadget
.
getUrlParameter
(
"
action
"
),
gadget
.
declareGadget
(
"
gadget_officejs_common_utils.html
"
)
gadget
.
declareGadget
(
"
gadget_officejs_common_utils.html
"
)
]);
]);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
action_reference
=
result
[
4
];
if
(
result
[
0
]
!==
undefined
)
{
options
.
portal_type
=
result
[
0
];
}
if
(
result
[
0
]
!==
undefined
)
{
options
.
portal_type
=
result
[
0
];
}
else
{
options
.
portal_type
=
result
[
2
];
}
if
(
result
[
1
]
!==
undefined
)
{
options
.
parent_relative_url
=
result
[
1
];
}
if
(
result
[
1
]
!==
undefined
)
{
options
.
parent_relative_url
=
result
[
1
];
}
else
{
options
.
parent_relative_url
=
result
[
3
];
}
action_reference
=
result
[
2
];
gadget_utils
=
result
[
5
];
gadget_utils
=
result
[
3
];
return
gadget
.
getActionFormDefinition
(
action_reference
);
return
gadget
.
getActionFormDefinition
(
action_reference
);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
...
@@ -67,7 +64,7 @@
...
@@ -67,7 +64,7 @@
form_definition
.
fields_raw_properties
.
hasOwnProperty
(
"
gadget_field_action_js_script
"
),
form_definition
.
fields_raw_properties
.
hasOwnProperty
(
"
gadget_field_action_js_script
"
),
state_options
=
{
state_options
=
{
doc
:
{},
doc
:
{},
parent
_options
:
options
,
action
_options
:
options
,
child_gadget_url
:
child_gadget_url
,
child_gadget_url
:
child_gadget_url
,
form_type
:
form_type
,
form_type
:
form_type
,
form_definition
:
form_definition
,
form_definition
:
form_definition
,
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
View file @
c7a632f1
...
@@ -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.
39692.31170.31266
</string>
</value>
<value>
<string>
975.
40675.7475.8960
</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>
15574
37551.19
</float>
<float>
15574
96526.16
</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