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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
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
Hide 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 @@
...
@@ -3,6 +3,29 @@
(
function
(
window
,
rJS
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
"
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
)
rJS
(
window
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Acquired methods
// Acquired methods
...
@@ -41,40 +64,22 @@
...
@@ -41,40 +64,22 @@
})
})
.
push
(
function
(
hateoas_url
)
{
.
push
(
function
(
hateoas_url
)
{
gadget
.
hateoas_url
=
hateoas_url
;
gadget
.
hateoas_url
=
hateoas_url
;
}).
push
(
function
()
{
// Do it synchronously, to ensure the full form
gadget
.
updateResourceListField
();
// will be displayed only when the select field has the expected
// values
return
updateResourceListField
(
gadget
);
});
});
})
})
.
declareMethod
(
'
triggerSubmit
'
,
function
()
{
.
declareMethod
(
'
triggerSubmit
'
,
function
()
{
return
this
.
form
.
triggerSubmit
();
return
this
.
form
.
triggerSubmit
();
})
})
.
declareJob
(
'
updateResourceListField
'
,
function
()
{
.
declareJob
(
'
deferUpdateResourceListField
'
,
function
()
{
var
gadget
=
this
,
return
updateResourceListField
(
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
;
}
});
})
})
.
onEvent
(
'
change
'
,
function
(
evt
)
{
.
onEvent
(
'
change
'
,
function
(
evt
)
{
var
gadget
=
this
;
var
gadget
=
this
;
if
(
evt
.
target
.
id
===
"
field_your_project
"
)
{
if
(
evt
.
target
.
id
===
"
field_your_project
"
)
{
gadget
.
u
pdateResourceListField
();
gadget
.
deferU
pdateResourceListField
();
}
}
},
false
,
false
);
},
false
,
false
);
}(
window
,
rJS
));
}(
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 @@
...
@@ -69,7 +69,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
content_type
</string>
</key>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
application/javascript
</string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
...
@@ -244,7 +246,7 @@
...
@@ -244,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.26853.29747.36369
</string>
</value>
<value>
<string>
1017.45366.38938.62225
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -264,8 +266,8 @@
...
@@ -264,8 +266,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
607511772.32
</float>
<float>
1
719991591.9
</float>
<string>
GMT+1
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</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