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
eb3a5942
Commit
eb3a5942
authored
May 02, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: fix form_view gadget render parameters
parent
3de2bb25
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
38 deletions
+51
-38
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+13
-6
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_form_view_js.js
...plateItem/web_page_module/gadget_officejs_form_view_js.js
+22
-23
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
+10
-3
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_controller_page_controller_js.js
View file @
eb3a5942
/*global window, rJS */
/*global window, rJS
, document
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
)
{
(
function
(
window
,
rJS
,
document
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -61,11 +61,18 @@
})
.
onStateChange
(
function
()
{
var
gadget
=
this
;
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
)
var
fragment
=
document
.
createElement
(
'
div
'
),
gadget
=
this
,
options
;
while
(
this
.
element
.
firstChild
)
{
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
}
this
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
,
{
element
:
fragment
,
scope
:
'
fg
'
})
.
push
(
function
(
form_view_gadget
)
{
return
form_view_gadget
.
render
Gadget
(
gadget
);
return
form_view_gadget
.
render
(
gadget
.
state
);
});
});
}(
window
,
rJS
));
\ No newline at end of file
}(
window
,
rJS
,
document
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
eb3a5942
...
...
@@ -225,7 +225,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.2
3887.3080.29184
</string>
</value>
<value>
<string>
975.2
9197.45196.34952
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -243,7 +243,7 @@
</tuple>
<state>
<tuple>
<float>
1556
575627.18
</float>
<float>
1556
807970.11
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.js
View file @
eb3a5942
...
...
@@ -95,40 +95,40 @@
return
form_json
;
})
.
declareMethod
(
"
render
Gadget
"
,
function
(
target_gadget
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
fragment
=
document
.
createElement
(
'
div
'
),
gadget
=
this
,
form_json
;
return
gadget
.
renderForm
(
target_gadget
.
state
.
form_definition
,
target_gadget
.
state
.
doc
)
return
gadget
.
renderForm
(
options
.
form_definition
,
options
.
doc
)
.
push
(
function
(
json
)
{
form_json
=
json
;
while
(
target_
gadget
.
element
.
firstChild
)
{
target_gadget
.
element
.
removeChild
(
target_
gadget
.
element
.
firstChild
);
while
(
gadget
.
element
.
firstChild
)
{
gadget
.
element
.
removeChild
(
gadget
.
element
.
firstChild
);
}
target_
gadget
.
element
.
appendChild
(
fragment
);
return
target_gadget
.
declareGadget
(
target_gadget
.
state
.
child_gadget_url
,
{
element
:
fragment
,
scope
:
'
fg
'
});
gadget
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
options
.
child_gadget_url
,
{
element
:
fragment
,
scope
:
'
fg
'
});
})
.
push
(
function
(
form_gadget
)
{
return
gadget
.
renderSubGadget
(
target_gadget
,
form_gadget
,
form_json
);
return
gadget
.
renderSubGadget
(
options
,
form_gadget
,
form_json
);
});
})
.
declareMethod
(
"
renderSubGadget
"
,
function
(
gadget
,
subgadget
,
form_json
)
{
.
declareMethod
(
"
renderSubGadget
"
,
function
(
options
,
subgadget
,
form_json
)
{
var
this_gadget
=
this
,
erp5_document
=
form_json
.
erp5_document
;
return
subgadget
.
render
({
jio_key
:
gadget
.
state
.
jio_key
,
doc
:
gadget
.
state
.
doc
,
jio_key
:
options
.
jio_key
,
doc
:
options
.
doc
,
erp5_document
:
form_json
.
erp5_document
,
form_definition
:
form_json
.
form_definition
,
editable
:
gadget
.
state
.
editable
,
view
:
gadget
.
state
.
view
,
editable
:
options
.
editable
,
view
:
options
.
view
,
form_json
:
form_json
})
// render the header
.
push
(
function
()
{
var
url_for_parameter_list
=
[
{
command
:
'
change
'
,
options
:
{
page
:
"
tab
"
}},
{
command
:
'
change
'
,
options
:
{
page
:
"
action_offline
"
,
jio_key
:
gadget
.
state
.
jio_key
}},
{
command
:
'
change
'
,
options
:
{
page
:
"
action_offline
"
,
jio_key
:
options
.
jio_key
}},
{
command
:
'
history_previous
'
},
{
command
:
'
selection_previous
'
},
{
command
:
'
selection_next
'
},
...
...
@@ -148,14 +148,14 @@
})
.
push
(
function
(
result_list
)
{
var
url_list
=
result_list
[
0
],
header_dict
;
if
(
gadget
.
state
.
form_type
===
'
dialog
'
)
{
if
(
options
.
form_type
===
'
dialog
'
)
{
header_dict
=
{
page_title
:
gadget
.
state
.
doc
.
title
,
page_title
:
options
.
doc
.
title
,
//TODO: find correct url
cancel_url
:
url_list
[
6
]
};
}
else
{
if
(
gadget
.
state
.
form_type
===
'
list
'
)
{
if
(
options
.
form_type
===
'
list
'
)
{
header_dict
=
{
panel_action
:
true
,
jump_url
:
""
,
...
...
@@ -169,21 +169,20 @@
selection_url
:
url_list
[
2
],
previous_url
:
url_list
[
3
],
next_url
:
url_list
[
4
],
page_title
:
gadget
.
state
.
doc
.
title
page_title
:
options
.
doc
.
title
};
if
(
gadget
.
state
.
has_more_views
)
{
if
(
options
.
has_more_views
)
{
header_dict
.
tab_url
=
url_list
[
0
];
}
if
(
gadget
.
state
.
editable
)
{
if
(
options
.
editable
)
{
header_dict
.
save_action
=
true
;
}
}
if
(
gadget
.
state
.
has_more_actions
)
{
if
(
options
.
has_more_actions
)
{
header_dict
.
actions_url
=
url_list
[
1
];
}
//TODO: fix index (must be last index, not a number)
if
(
url_list
[
7
])
{
header_dict
.
add_url
=
url_list
[
7
];
if
(
url_list
[
url_list
.
length
-
1
])
{
header_dict
.
add_url
=
url_list
[
url_list
.
length
-
1
];
}
if
(
result_list
[
1
])
{
header_dict
.
export_url
=
(
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.xml
View file @
eb3a5942
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.2
3842.17340.49459
</string>
</value>
<value>
<string>
975.2
9199.21743.1211
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1556
637363.69
</float>
<float>
1556
807969.14
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
View file @
eb3a5942
...
...
@@ -92,10 +92,17 @@
})
.
onStateChange
(
function
()
{
var
gadget
=
this
;
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
)
var
fragment
=
document
.
createElement
(
'
div
'
),
gadget
=
this
,
options
;
while
(
this
.
element
.
firstChild
)
{
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
}
this
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
,
{
element
:
fragment
,
scope
:
'
fg
'
})
.
push
(
function
(
form_view_gadget
)
{
return
form_view_gadget
.
render
Gadget
(
gadget
);
return
form_view_gadget
.
render
(
gadget
.
state
);
});
})
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
View file @
eb3a5942
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.2
5263.50685.65109
</string>
</value>
<value>
<string>
975.2
9197.38946.55620
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1556
658280.76
</float>
<float>
1556
807973.08
</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