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
139
Merge Requests
139
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
871b5518
Commit
871b5518
authored
Jul 02, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_support_request_ui: control the initial rendering
parent
9b828672
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
29 deletions
+36
-29
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_fast_view_dialog_js.js
..._page_module/gadget_supportrequest_fast_view_dialog_js.js
+30
-25
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_fast_view_dialog_js.xml
...page_module/gadget_supportrequest_fast_view_dialog_js.xml
+6
-4
No files found.
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_fast_view_dialog_js.js
View file @
871b5518
...
...
@@ -3,6 +3,29 @@
(
function
(
window
,
rJS
)
{
"
use strict
"
;
function
updateResourceListField
(
gadget
)
{
var
selectedProject
=
gadget
.
element
.
querySelector
(
'
#field_your_project
'
).
value
;
return
gadget
.
jio_getAttachment
(
'
support_request_module
'
,
gadget
.
hateoas_url
+
'
support_request_module
'
+
"
/SupportRequest_getSupportTypeList
"
+
"
?project_id=
"
+
selectedProject
+
"
&json_flag=True
"
).
push
(
function
(
sp_list
)
{
var
i
,
j
,
sp_select
=
gadget
.
element
.
querySelector
(
'
#field_your_resource
'
);
for
(
i
=
sp_select
.
options
.
length
-
1
;
i
>=
0
;
i
-=
1
)
{
sp_select
.
remove
(
i
);
}
for
(
j
=
0
;
j
<
sp_list
.
length
;
j
+=
1
)
{
sp_select
.
options
[
j
]
=
new
Option
(
sp_list
[
j
][
0
],
sp_list
[
j
][
1
]);
}
if
(
sp_select
.
options
.
length
===
2
)
{
sp_select
.
selectedIndex
=
1
;
}
});
}
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
...
...
@@ -41,40 +64,22 @@
})
.
push
(
function
(
hateoas_url
)
{
gadget
.
hateoas_url
=
hateoas_url
;
}).
push
(
function
()
{
gadget
.
updateResourceListField
();
// Do it synchronously, to ensure the full form
// will be displayed only when the select field has the expected
// values
return
updateResourceListField
(
gadget
);
});
})
.
declareMethod
(
'
triggerSubmit
'
,
function
()
{
return
this
.
form
.
triggerSubmit
();
})
.
declareJob
(
'
updateResourceListField
'
,
function
()
{
var
gadget
=
this
,
selectedProject
=
document
.
getElementById
(
'
field_your_project
'
).
value
;
return
gadget
.
jio_getAttachment
(
'
support_request_module
'
,
gadget
.
hateoas_url
+
'
support_request_module
'
+
"
/SupportRequest_getSupportTypeList
"
+
"
?project_id=
"
+
selectedProject
+
"
&json_flag=True
"
).
push
(
function
(
sp_list
)
{
var
i
,
j
,
sp_select
=
document
.
getElementById
(
'
field_your_resource
'
);
for
(
i
=
sp_select
.
options
.
length
-
1
;
i
>=
0
;
i
-=
1
)
{
sp_select
.
remove
(
i
);
}
for
(
j
=
0
;
j
<
sp_list
.
length
;
j
+=
1
)
{
sp_select
.
options
[
j
]
=
new
Option
(
sp_list
[
j
][
0
],
sp_list
[
j
][
1
]);
}
if
(
sp_select
.
options
.
length
===
2
)
{
sp_select
.
selectedIndex
=
1
;
}
});
.
declareJob
(
'
deferUpdateResourceListField
'
,
function
()
{
return
updateResourceListField
(
this
);
})
.
onEvent
(
'
change
'
,
function
(
evt
)
{
var
gadget
=
this
;
if
(
evt
.
target
.
id
===
"
field_your_project
"
)
{
gadget
.
u
pdateResourceListField
();
gadget
.
deferU
pdateResourceListField
();
}
},
false
,
false
);
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_fast_view_dialog_js.xml
View file @
871b5518
...
...
@@ -69,7 +69,9 @@
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
application/javascript
</string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
...
...
@@ -244,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.26853.29747.36369
</string>
</value>
<value>
<string>
1017.45366.38938.62225
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,8 +266,8 @@
</tuple>
<state>
<tuple>
<float>
1
607511772.32
</float>
<string>
GMT+1
</string>
<float>
1
719991591.9
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
...
...
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