Commit 8c536a73 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Allow Computer, service and Network be transferred between Organisations

parent f925ed8d
......@@ -140,6 +140,17 @@
"title": "Current Project",
"default": gadget.state.doc.source_project_title,
"css_class": "",
"required": 0,
"editable": 0,
"key": "",
"hidden": 0,
"type": "StringField"
},
"my_source_section": {
"description": "The name of a document in ERP5",
"title": "Current Organisation",
"default": gadget.state.doc.source_section_title,
"css_class": "",
"required": 1,
"editable": 0,
"key": "",
......@@ -180,7 +191,7 @@
[["my_title"], ["my_reference"]]
], [
"right",
[['my_monitoring_status'], ["my_source_project"]]
[['my_monitoring_status'], ["my_source_project"], ["my_source_section"]]
], [
"bottom",
[["listbox"]]
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.54433.31362.16861</string> </value>
<value> <string>976.63062.57955.57890</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1562167951.36</float>
<float>1562685619.84</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -280,6 +280,17 @@
"hidden": 0,
"type": "StringField"
},
"my_source": {
"description": "The name of a document in ERP5",
"title": "Current Organisation",
"default": gadget.state.doc.source_title,
"css_class": "",
"required": 0,
"editable": 0,
"key": "source_title",
"hidden": 0,
"type": "StringField"
},
"my_monitoring_status": {
"description": "",
"title": "Monitoring Status",
......@@ -400,7 +411,7 @@
[["my_title"], ["my_reference"], ["my_short_title"], ["my_description"]]
], [
"right",
[["my_slap_state_title"], ['my_monitoring_status'], ['my_monitor_scope'], ['my_upgrade_scope'], ['my_source_project']]
[["my_slap_state_title"], ['my_monitoring_status'], ['my_monitor_scope'], ['my_upgrade_scope'], ['my_source_project'], ['my_source']]
], ["center",
[["my_source_reference"], ["my_url_string"]]
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.53553.17660.802</string> </value>
<value> <string>976.53561.48622.46421</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1562115464.51</float>
<float>1562697582.58</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -76,7 +76,7 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
gadget.jio_allDocs({
query: 'portal_type:"Organisation" AND relative_url:(' + destination_list + ')',
query: 'portal_type:"Organisation" AND role_title: "Host" AND relative_url:(' + destination_list + ')',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
}),
......@@ -84,6 +84,11 @@
query: 'portal_type:"Project" AND validation_state:"validated" AND relative_url:(' + destination_project_list + ')',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
}),
gadget.jio_allDocs({
query: 'portal_type:"Organisation" AND role_title: "Client" AND relative_url:(' + destination_list + ')',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
})
]);
})
......@@ -91,8 +96,10 @@
var doc = result[1],
site_list = [["", ""]],
project_list = [["", ""]],
organisation_list = [["", ""]],
i, value, project_len = result[3].data.total_rows,
site_len = result[2].data.total_rows;
site_len = result[2].data.total_rows,
organisation_len = result[4].data.total_rows;
for (i = 0; i < site_len; i += 1) {
site_list.push([
......@@ -108,6 +115,13 @@
]);
}
for (i = 0; i < organisation_len; i += 1) {
organisation_list.push([
result[4].data.rows[i].value.title ? result[4].data.rows[i].value.title : result[4].data.rows[i].value.reference,
result[4].data.rows[i].id
]);
}
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
......@@ -179,6 +193,29 @@
"hidden": 0,
"type": "ListField"
},
"my_source_section": {
"description": "The name of a document in ERP5",
"title": "Current Organisation",
"default": doc.source_section_title,
"css_class": "",
"required": 1,
"editable": 0,
"key": "source_section_title",
"hidden": 0,
"type": "StringField"
},
"my_destination_section": {
"description": "The name of a document in ERP5",
"title": "Future Organisation",
"default": "",
"items": organisation_list,
"css_class": "",
"required": 1,
"editable": 1,
"key": "destination_section",
"hidden": 0,
"type": "ListField"
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
......@@ -201,7 +238,8 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_source"], ["my_source_project"], ["my_destination"], ["my_destination_project"], ["my_relative_url"]]
[["my_title"], ["my_reference"], ["my_source_section"], ["my_source"], ["my_source_project"],
["my_destination"], ["my_destination_project"], ["my_destination_section"], ["my_relative_url"]]
]]
}
});
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.32024.53732.34406</string> </value>
<value> <string>976.63583.16434.8499</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1562639281.01</float>
<float>1562716830.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -66,10 +66,13 @@
return gadget.jio_get(setting);
})
.push(function (me) {
var i, destination_project_list = '"NULL",';
var i, destination_list = '"NULL",', destination_project_list = '"NULL",';
for (i in me.assignment_destination_project_list) {
destination_project_list += '"' + me.assignment_destination_project_list[i] + '",';
}
for (i in me.assignment_destination_list) {
destination_list += '"' + me.assignment_destination_list[i] + '",';
}
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
......@@ -77,14 +80,20 @@
query: 'portal_type:"Project" AND validation_state:"validated" AND relative_url:(' + destination_project_list + ')',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
})
}),
gadget.jio_allDocs({
query: 'portal_type:"Organisation" AND role_title: "Client" AND relative_url:(' + destination_list + ')',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
})
]);
})
.push(function (result) {
var doc = result[1],
site_list = [["", ""]],
organisation_list = [["", ""]],
project_list = [["", ""]],
i, value, project_len = result[2].data.total_rows;
i, value, project_len = result[2].data.total_rows,
organisation_len = result[3].data.total_rows;
for (i = 0; i < project_len; i += 1) {
project_list.push([
......@@ -93,6 +102,13 @@
]);
}
for (i = 0; i < organisation_len; i += 1) {
organisation_list.push([
result[3].data.rows[i].value.title ? result[3].data.rows[i].value.title : result[3].data.rows[i].value.reference,
result[3].data.rows[i].id
]);
}
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
......@@ -141,6 +157,29 @@
"hidden": 0,
"type": "ListField"
},
"my_source_section": {
"description": "The name of a document in ERP5",
"title": "Current Organisation",
"default": doc.source_section_title,
"css_class": "",
"required": 1,
"editable": 0,
"key": "source_section_title",
"hidden": 0,
"type": "StringField"
},
"my_destination_section": {
"description": "The name of a document in ERP5",
"title": "Future Organisation",
"default": "",
"items": organisation_list,
"css_class": "",
"required": 1,
"editable": 1,
"key": "destination_section",
"hidden": 0,
"type": "ListField"
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
......@@ -163,7 +202,7 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_source_project"], ["my_destination_project"], ["my_relative_url"]]
[["my_title"], ["my_reference"], ["my_source_project"], ["my_source_section"], ["my_destination_project"], ["my_destination_section"], ["my_relative_url"]]
]]
}
});
......
......@@ -271,7 +271,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.62093.51594.26214</string> </value>
<value> <string>976.63058.9497.29047</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -289,7 +289,7 @@
</tuple>
<state>
<tuple>
<float>1562629628.15</float>
<float>1562685363.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -76,7 +76,7 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
gadget.jio_allDocs({
query: 'portal_type:"Organisation" AND relative_url:(' + destination_list + ')',
query: 'portal_type:"Organisation" AND role_title: "Client" AND relative_url:(' + destination_list + ')',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
}),
......@@ -89,7 +89,7 @@
})
.push(function (result) {
var doc = result[1],
site_list = [["", ""]],
organisation_list = [["", ""]],
project_list = [["", ""]],
i,
value,
......@@ -97,7 +97,7 @@
site_len = result[2].data.total_rows;
for (i = 0; i < site_len; i += 1) {
site_list.push([
organisation_list.push([
result[2].data.rows[i].value.title ? result[2].data.rows[i].value.title : result[2].data.rows[i].value.reference,
result[2].data.rows[i].id
]);
......@@ -146,6 +146,29 @@
"hidden": 0,
"type": "StringField"
},
"my_destination": {
"description": "The name of a document in ERP5",
"title": "Future Organisation",
"default": "",
"items": organisation_list,
"css_class": "",
"required": 1,
"editable": 1,
"key": "destination",
"hidden": 0,
"type": "ListField"
},
"my_source": {
"description": "The name of a document in ERP5",
"title": "Current Organisation",
"default": doc.source_title,
"css_class": "",
"required": 1,
"editable": 0,
"key": "source_title",
"hidden": 0,
"type": "StringField"
},
"my_destination_project": {
"description": "The name of a document in ERP5",
"title": "Future Project",
......@@ -180,7 +203,8 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_source_project"], ["my_destination_project"], ["my_relative_url"]]
[["my_title"], ["my_reference"], ["my_source_project"], ["my_source"],
["my_destination_project"], ["my_destination"], ["my_relative_url"]]
]]
}
});
......
......@@ -271,7 +271,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.53587.16960.43827</string> </value>
<value> <string>976.63257.63038.55210</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -289,7 +289,7 @@
</tuple>
<state>
<tuple>
<float>1562640396.08</float>
<float>1562697293.25</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -108,7 +108,7 @@
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
# generated on Fri, 9 JuL 2019 10:00:00 GMT+0200\n
# generated on Fri, 9 JuL 2019 10:00:07 GMT+0200\n
CACHE:\n
favicon.ico\n
font-awesome/font-awesome-webfont.eot?v=4.6.3\n
......@@ -371,11 +371,11 @@ gadget_erp5_page_slap_ticket_list.html\n
gadget_erp5_page_slap_ticket_list.js\n
gadget_erp5_page_slap_ticket_view.js\n
gadget_erp5_page_slap_transfer_computer.html\n
gadget_erp5_page_slap_transfer_computer.js\n
#gadget_erp5_page_slap_transfer_computer.js\n
gadget_erp5_page_slap_transfer_hosting_subscription.html\n
gadget_erp5_page_slap_transfer_hosting_subscription.js\n
#gadget_erp5_page_slap_transfer_hosting_subscription.js\n
gadget_erp5_page_slap_transfer_computer_network.html\n
gadget_erp5_page_slap_transfer_computer_network.js\n
#gadget_erp5_page_slap_transfer_computer_network.js\n
gadget_erp5_page_slap_trial_request_message.html\n
gadget_erp5_page_slap_trial_request_message.js\n
gadget_erp5_page_slap_upgrade_decision_view.html\n
......@@ -579,7 +579,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.62292.13005.43588</string> </value>
<value> <string>976.63583.28202.43076</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -597,7 +597,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1562640407.16</float>
<float>1562716840.37</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -97,6 +97,7 @@
<string>my_reference</string>
<string>my_news</string>
<string>my_source_project_title</string>
<string>my_source_section_title</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_section_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Current Organisation</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Item_getCurrentOwnerValue().title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -108,6 +108,7 @@
<string>my_connection_parameter_list</string>
<string>my_upgrade_scope</string>
<string>my_source_project_title</string>
<string>my_source_title</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Current Organisation</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Item_getCurrentSiteValue().title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment