Commit bea2620a authored by Lu Xu's avatar Lu Xu 👀

slapos_jio: translate hostingjs site in Chinese

Co-authored-by: Thomas Gambier's avatarThomas Gambier <thomas.gambier@nexedi.com>
parent a8628921
<!doctype html>
<html>
<!--
data-i18n=Parent Relative Url
data-i18n=Reject Upgrade Decision:
-->
<head>
<meta charset="utf-8">
......
......@@ -175,6 +175,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -235,4 +241,64 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1583942041.12</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -13,7 +13,7 @@
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -47,22 +47,29 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Parent Relative Url",
"Reject Upgrade Decision:"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key)
gadget.jio_get(options.jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
page_title_translation = result[2][1];
options.doc = result[1];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[2][0],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -94,7 +101,7 @@
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Reject Upgrade Decision: " + options.doc.title,
page_title: page_title_translation + " " + options.doc.title,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -171,6 +171,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -231,4 +237,64 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1584116899.36</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
</ZopeData>
<!doctype html>
<html>
<!--
data-i18n=Parent Relative Url
data-i18n=Accept Upgrade Decision:
-->
<head>
<meta charset="utf-8">
......
......@@ -175,6 +175,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -235,4 +241,64 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1583941092.91</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -13,7 +13,7 @@
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -35,7 +35,7 @@
url + doc.relative_url + "/UpgradeDecision_requestChangeState", {requested_state: "started"});
});
})
.push(function (result) {
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change", "options": {"page": "slap_controller"}});
});
......@@ -46,22 +46,29 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Parent Relative Url",
"Accept Upgrade Decision:"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key)
gadget.jio_get(options.jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
options.doc = result[1];
page_title_translation = result[2][1];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[2][0],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -93,7 +100,7 @@
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Accept Upgrade Decision: " + options.doc.title,
page_title: page_title_translation + " " + options.doc.title,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -171,6 +171,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -231,4 +237,64 @@
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1584116853.37</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<!--
data-i18n=User
data-i18n=Language
data-i18n=Update
data-i18n=You are not allowed to access this content, please login with an user which has the right permission
data-i18n=Error page
data-i18n=Logout
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.35642.21160.39253</string> </value>
<value> <string>982.32792.55683.53538</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1576598237.42</float>
<float>1584116736.52</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, Handlebars, UriTemplate */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars, UriTemplate) {
(function (window, rJS, RSVP, UriTemplate) {
"use strict";
var gadget_klass = rJS(window),
dialog_button_source = gadget_klass.__template_element
.getElementById("dialog-button-template")
.innerHTML,
dialog_button_template = Handlebars.compile(dialog_button_source);
var gadget_klass = rJS(window);
gadget_klass
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
......@@ -20,31 +15,34 @@
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function () {
var gadget = this;
var gadget = this,
logout_translation,
translation_list = [
"You are not allowed to access this content, please login with an user which has the right permission",
"Error page",
"Logout"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getUrlForList([{command: 'display'}]),
gadget.getDeclaredGadget("erp5_form"),
gadget.translate("You are not allowed to access this content, please login with an user which has the right permission")
gadget.getTranslationList(translation_list)
]);
})
.push(function (result_list) {
var user,
key,
list_item = [];
logout_translation = result_list[2][2];
return RSVP.all([
gadget.updateHeader({
page_title: 'Error page',
page_title: result_list[2][1],
front_url: result_list[0][0]
}),
result_list[1].render({
erp5_document: {"_embedded": {"_view": {
'Message': {
"default": result_list[2],
"default": result_list[2][0],
"editable": 0,
"key": "field_message",
"title": "",
......@@ -57,27 +55,27 @@
}
}
},
form_definition: {
group_list: [[
"left",
[["Message"]]
]]
}
})
]);
})
.push(function () {
return gadget.translate('Logout');
form_definition: {
group_list: [[
"left",
[["Message"]]
]]
}
})
]);
})
.push(function (translated_text) {
gadget.element.querySelector('input').value = translated_text;
.push(function () {
// return gadget.translate('Logout');
// })
// .push(function (translated_text) {
gadget.element.querySelector('input').value = logout_translation;
});
})
.onEvent('submit', function () {
var gadget = this,
logout_url_template;
var gadget = this,
logout_url_template;
return gadget.jio_getAttachment('acl_users', 'links')
return gadget.jio_getAttachment('acl_users', 'links')
.push(function (links) {
logout_url_template = links._links.logout.href;
return gadget.getUrlFor({
......@@ -94,8 +92,8 @@
}
});
});
})
})
.declareMethod("triggerSubmit", function () {
return;
});
}(window, rJS, RSVP, Handlebars, UriTemplate));
}(window, rJS, RSVP, UriTemplate));
......@@ -229,7 +229,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.38250.49558.15530</string> </value>
<value> <string>982.32788.64233.60996</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -247,7 +247,7 @@
</tuple>
<state>
<tuple>
<float>1576752736.24</float>
<float>1584116798.25</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=New Computer created.
data-i18n=The name of a document in ERP5
data-i18n=Title
data-i18n=Reference
data-i18n=Link to the Computer
data-i18n=Your Certificate
data-i18n=Your Key
data-i18n=Parent Relative Url
data-i18n=New Computer
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.658.19064.11434</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1508946400.8</float>
<float>1583936933.19</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,6 +14,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -40,7 +41,7 @@
});
})
.push(function (result) {
return gadget.notifySubmitted({message: 'New Computer created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
return gadget.render(result);
});
......@@ -52,78 +53,92 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"New Computer created.",
"The name of a document in ERP5",
"Title",
"Reference",
"Link to the Computer",
"Your Certificate",
"Your Key",
"Parent Relative Url",
"New Computer"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getUrlFor({command: "change",
options: { jio_key: options.relative_url, page: "slap_controller"}})
options: { jio_key: options.relative_url, page: "slap_controller"}}),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[2][0];
page_title_translation = result[2][8];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"description": result[2][1],
"title": result[2][2],
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "title",
"hidden": (options.certificate === undefined) ? 0: 1,
"hidden": (options.certificate === undefined) ? 0 : 1,
"type": "StringField"
},
"my_reference": {
"description": "The name of a document in ERP5",
"title": "Reference",
"description": result[2][1],
"title": result[2][3],
"default": options.reference,
"css_class": "",
"required": 1,
"editable": 0,
"key": "reference",
"hidden": (options.reference === undefined) ? 1: 0,
"hidden": (options.reference === undefined) ? 1 : 0,
"type": "StringField"
},
"my_computer_url": {
"description": "",
"title": "Link to the Computer",
"title": result[2][4],
"default": "<a href=" + result[1] + "> Click here to access your computer </a>",
"css_class": "",
"required": 1,
"editable": 0,
"key": "computer_url",
"hidden": (options.certificate === undefined) ? 1: 0,
"hidden": (options.certificate === undefined) ? 1 : 0,
"type": "EditorField"
},
"my_certificate": {
"description": "",
"title": "Your Certificate",
"title": result[2][5],
"default": options.certificate,
"css_class": "",
"required": 1,
"editable": 1,
"key": "certificate",
"hidden": (options.certificate === undefined) ? 1: 0,
"hidden": (options.certificate === undefined) ? 1 : 0,
"type": "TextAreaField"
},
"my_key": {
"description": "",
"title": "Your Key",
"title": result[2][6],
"default": options.key,
"css_class": "",
"required": 1,
"editable": 1,
"key": "key",
"hidden": (options.key === undefined) ? 1: 0,
"hidden": (options.key === undefined) ? 1 : 0,
"type": "TextAreaField"
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[2][7],
"default": "computer_module",
"css_class": "",
"required": 1,
......@@ -161,7 +176,7 @@
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "New Computer",
page_title: page_title_translation,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.48704.22248.60467</string> </value>
<value> <string>982.32776.2527.7833</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1523286392.39</float>
<float>1584115729.34</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Please review the form.
data-i18n=New service created.
data-i18n=The name of a document in ERP5
data-i18n=Software Release URL
data-i18n=Title
data-i18n=Instance Parameter
data-i18n=Computer
data-i18n=SLA
data-i18n=Parent Relative Url
data-i18n=3/3 Request Service:
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.544.16805.21043</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508939574.79</float>
<float>1583926473.75</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3, sub:true */
(function (window, rJS, RSVP) {
"use strict";
......@@ -16,6 +16,7 @@
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -41,15 +42,15 @@
})
.push(function (doc) {
if (doc === null) {
return gadget.notifySubmitted({message: 'Please review the form.', status: 'error'});
return gadget.notifySubmitted({message: gadget.message1_translation, status: 'error'});
}
return gadget.getSetting("hateoas_url")
.push(function (url) {
return gadget.jio_putAttachment(doc.relative_url,
url + doc.relative_url + "/SoftwareRelease_requestHostingSubscription", doc);
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New service created.', status: 'success'})
.push(function () {
return gadget.notifySubmitted({message: gadget.message2_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -57,12 +58,11 @@
});
}, function (error) {
if (error.target.status === 409) {
return gadget.notifySubmitted({message: 'A service with this title already exists.', status: 'error'});
return gadget.notifySubmitted({message: gadget.message3_translation, status: 'error'});
}
if (error.target.status === 400) {
return gadget.notifySubmitted({message: 'Service Title is mandatory.', status: 'error'});
return gadget.notifySubmitted({message: gadget.message4_translation, status: 'error'});
}
});
});
})
......@@ -72,15 +72,36 @@
})
.declareMethod("render", function (options) {
var gadget = this;
var gadget = this,
page_title_translation,
translation_list = [
"Please review the form.",
"New service created.",
"The name of a document in ERP5",
"Software Release URL",
"Title",
"Instance Parameter",
"Computer",
"SLA",
"Parent Relative Url",
"3/3 Request Service:",
"A service with this title already exists.",
"Service Title is mandatory."
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key)
gadget.jio_get(options.jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message1_translation = result[2][0];
gadget.message2_translation = result[2][1];
gadget.message3_translation = result[2][10];
gadget.message4_translation = result[2][11];
page_title_translation = result[2][9];
var doc = result[1],
parameter_dict = {
'parameter' : {
......@@ -93,18 +114,17 @@
if (options.software_type) {
parameter_dict["parameter"]['restricted_softwaretype'] = true;
parameter_dict["parameter"]['softwaretype'] = options.software_type;
}
if (options.shared) {
parameter_dict["parameter"]['shared'] = true;
parameter_dict["parameter"]['shared'] = true;
}
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_url_string": {
"description": "The name of a document in ERP5",
"title": "Software Release URL",
"description": result[2][2],
"title": result[2][3],
"default": doc.url_string,
"css_class": "",
"required": 1,
......@@ -114,8 +134,8 @@
"type": "StringField"
},
"your_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"description": result[2][2],
"title": result[2][4],
"default": "",
"css_class": "",
"required": 1,
......@@ -126,7 +146,7 @@
},
"your_text_content": {
"description": "",
"title": "Instance Parameter",
"title": result[2][5],
"default": parameter_dict,
"css_class": "",
"required": 1,
......@@ -138,8 +158,8 @@
"type": "GadgetField"
},
"your_computer_guid": {
"description": "The name of a document in ERP5",
"title": "Computer",
"description": result[2][2],
"title": result[2][6],
"default": "",
"items": doc.computer_guid,
"css_class": "",
......@@ -150,8 +170,8 @@
"type": "ListField"
},
"your_sla_xml": {
"description": "The name of a document in ERP5",
"title": "SLA",
"description": result[2][2],
"title": result[2][7],
"default": options.sla_xml,
"css_class": "",
"required": 0,
......@@ -162,7 +182,7 @@
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[2][8],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -183,23 +203,22 @@
group_list: [[
"center",
[["my_url_string"], ["your_title"], ["your_text_content"],
["your_computer_guid"],["your_sla_xml"], ["my_portal_type"], ["my_relative_url"]]
["your_computer_guid"], ["your_sla_xml"], ["my_portal_type"], ["my_relative_url"]]
]]
}
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'cancel_dialog_with_history'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "3/3 Request Service: " + doc.title,
cancel_url: url_list[0],
submit_action: true
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'cancel_dialog_with_history'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: page_title_translation + " " + doc.title,
cancel_url: url_list[0],
submit_action: true
});
});
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>982.17545.17272.64904</string> </value>
<value> <string>982.38874.39126.59716</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1583203969.98</float>
<float>1584481681.97</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Title
data-i18n=Portal Type
data-i18n=Parent Relative Url
data-i18n=New Network
data-i18n=New Network created.
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.58873.57599.16861</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1508507177.27</float>
<float>1583226710.52</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,6 +14,7 @@
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -35,7 +36,7 @@
return gadget.jio_post(doc);
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New Network created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -49,20 +50,31 @@
})
.declareMethod("render", function () {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Title",
"Portal Type",
"Parent Relative Url",
"New Network",
"New Network created."
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
page_title_translation = result[1][3];
gadget.message_translation = result[1][4];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"title": result[1][0],
"default": "",
"css_class": "",
"required": 0,
......@@ -73,7 +85,7 @@
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"title": result[1][1],
"default": "Computer Network",
"css_class": "",
"required": 1,
......@@ -84,7 +96,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[1][2],
"default": "computer_network_module",
"css_class": "",
"required": 1,
......@@ -116,7 +128,7 @@
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "New Network",
page_title: page_title_translation,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.48705.14270.63044</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1523284357.6</float>
<float>1584115573.75</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=New Site created.
data-i18n=The name of a document in ERP5
data-i18n=Title
data-i18n=Role Definition
data-i18n=Role
data-i18n=Portal Type
data-i18n=Organisation
data-i18n=Parent Relative Url
data-i18n=New Site
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.59062.38947.47206</string> </value>
<value> <string>982.29607.52887.6178</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1508518520.22</float>
<float>1583925598.36</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -20,6 +20,7 @@
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -44,7 +45,7 @@
return gadget.jio_post(doc);
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New Site created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -58,20 +59,35 @@
})
.declareMethod("render", function () {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"New Site created.",
"The name of a document in ERP5",
"Title",
"Role Definition",
"Role",
"Portal Type",
"Organisation",
"Parent Relative Url",
"New Site"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[1][0];
page_title_translation = result[1][8];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"description": result[1][1],
"title": result[1][2],
"default": "",
"css_class": "",
"required": 0,
......@@ -81,8 +97,8 @@
"type": "StringField"
},
"my_role": {
"description": "Role Definition",
"title": "Role",
"description": result[1][3],
"title": result[1][4],
"default": "host",
"css_class": "",
"required": 0,
......@@ -92,8 +108,8 @@
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"description": result[1][1],
"title": result[1][5],
"default": "Organisation",
"css_class": "",
"required": 1,
......@@ -104,7 +120,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[1][7],
"default": "organisation_module",
"css_class": "",
"required": 1,
......@@ -129,14 +145,14 @@
}
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: "slap_site_list"}})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "New Site",
page_title: page_title_translation,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -285,7 +285,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.44603.20243.21469</string> </value>
<value> <string>983.7927.45169.51575</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1523284444.13</float>
<float>1586563668.89</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=New Project created.
data-i18n=The name of a document in ERP5
data-i18n=Title
data-i18n=Description
data-i18n=Destination Decision
data-i18n=Portal Type
data-i18n=Project
data-i18n=Parent Relative Url
data-i18n=New Project
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.58911.59447.25480</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1508509651.65</float>
<float>1583925144.16</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,6 +14,7 @@
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -35,7 +36,7 @@
return gadget.jio_post(doc);
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New Project created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -49,21 +50,36 @@
})
.declareMethod("render", function () {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"New Project created.",
"The name of a document in ERP5",
"Title",
"Description",
"Destination Decision",
"Portal Type",
"Project",
"Parent Relative Url",
"New Project"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting('me')
gadget.getSetting('me'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[2][0];
page_title_translation = result[2][8];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"description": result[2][1],
"title": result[2][2],
"default": "",
"css_class": "",
"required": 1,
......@@ -73,8 +89,8 @@
"type": "StringField"
},
"my_description": {
"description": "The name of a document in ERP5",
"title": "Description",
"description": result[2][1],
"title": result[2][3],
"default": "",
"css_class": "",
"required": 0,
......@@ -85,7 +101,7 @@
},
"my_destination_decision": {
"description": "",
"title": "Destination Decision",
"title": result[2][4],
"default": result[1],
"css_class": "",
"required": 1,
......@@ -95,8 +111,8 @@
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"description": result[2][1],
"title": result[2][5],
"default": "Project",
"css_class": "",
"required": 1,
......@@ -107,7 +123,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[2][7],
"default": "project_module",
"css_class": "",
"required": 1,
......@@ -134,7 +150,7 @@
})
.push(function () {
return gadget.updateHeader({
page_title: "New Project",
page_title: page_title_translation,
submit_action: true
});
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.20790.10907.2884</string> </value>
<value> <string>983.7927.45169.51575</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1520360988.47</float>
<float>1586563069.28</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=The name of a document in ERP5
data-i18n=Title
data-i18n=Include your message
data-i18n=Your Message
data-i18n=Source
data-i18n=Follow up
data-i18n=Portal Type
data-i18n=Web Message
data-i18n=Parent Relative Url
data-i18n=New Message
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.3427.16399.8806</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1509112532.59</float>
<float>1583924073.29</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,7 +14,7 @@
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -44,24 +44,39 @@
})
.declareMethod("render", function (options) {
var gadget = this;
var gadget = this,
page_title_translation,
translation_list = [
"The name of a document in ERP5",
"Title",
"Include your message",
"Your Message",
"Source",
"Follow up",
"Portal Type",
"Web Message",
"Parent Relative Url",
"New Message"
];
gadget.state.jio_key = options.jio_key;
return RSVP.Queue()
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting('me'),
gadget.jio_get(gadget.state.jio_key)
gadget.jio_get(gadget.state.jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
page_title_translation = result[3][9];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"description": result[3][0],
"title": result[3][1],
"default": "Re: " + result[2].title,
"css_class": "",
"required": 1,
......@@ -71,8 +86,8 @@
"type": "StringField"
},
"my_text_content": {
"description": "Include your message",
"title": "Your Message",
"description": result[3][2],
"title": result[3][3],
"default": "",
"css_class": "",
"required": 1,
......@@ -83,7 +98,7 @@
},
"my_source": {
"description": "",
"title": "Source",
"title": result[3][4],
"default": result[1],
"css_class": "",
"required": 1,
......@@ -94,7 +109,7 @@
},
"my_follow_up": {
"description": "",
"title": "Follow up",
"title": result[3][5],
"default": gadget.state.jio_key,
"css_class": "",
"required": 1,
......@@ -104,8 +119,8 @@
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"description": result[3][0],
"title": result[3][6],
"default": "Web Message",
"css_class": "",
"required": 1,
......@@ -116,7 +131,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][8],
"default": "event_module",
"css_class": "",
"required": 1,
......@@ -137,20 +152,20 @@
group_list: [[
"center",
[["my_title"], ["my_text_content"], ["my_follow_up"],
["my_portal_type"], ["my_parent_relative_url"],
["my_follow_up"], ["my_source"]]
["my_portal_type"], ["my_parent_relative_url"],
["my_follow_up"], ["my_source"]]
]]
}
});
})
.push(function () {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "New Message",
page_title: page_title_translation,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -285,7 +285,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.37270.25301.10137</string> </value>
<value> <string>983.7927.45169.51575</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1545841502.46</float>
<float>1586564011.64</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=New Ticket created.
data-i18n=The name of a document in ERP5
data-i18n=Subject
data-i18n=Message
data-i18n=Ticket Type
data-i18n=Current User
data-i18n=Trade Condition
data-i18n=Aggregate
data-i18n=Portal Type
data-i18n=Support Request
data-i18n=Parent Relative Url
data-i18n=New Ticket related to
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.6873.14525.36027</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1575974033.34</float>
<float>1583923386.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -49,7 +49,7 @@
return gadget.jio_post(doc);
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New Ticket created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -62,10 +62,25 @@
})
.declareMethod("render", function (options) {
var gadget = this;
var gadget = this,
page_title_translation,
translation_list = [
"New Ticket created.",
"The name of a document in ERP5",
"Subject",
"Message",
"Ticket Type",
"Current User",
"Trade Condition",
"Aggregate",
"Portal Type",
"Support Request",
"Parent Relative Url",
"New Ticket related to"
];
gadget.state.jio_key = options.jio_key;
return RSVP.Queue()
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("hateoas_url");
})
......@@ -74,16 +89,19 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_getAttachment("ticket_resource_list",
hateoas_url + "Ticket_getResourceItemListAsJSON"),
window.getSettingMe(gadget)
window.getSettingMe(gadget),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[3][0];
page_title_translation = result[3][11];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Subject",
"description": result[3][1],
"title": result[3][2],
"default": "",
"css_class": "",
"required": 1,
......@@ -93,8 +111,8 @@
"type": "StringField"
},
"my_description": {
"description": "The name of a document in ERP5",
"title": "Message",
"description": result[3][1],
"title": result[3][3],
"default": "",
"css_class": "",
"required": 1,
......@@ -104,8 +122,8 @@
"type": "TextAreaField"
},
"my_resource": {
"description": "The name of a document in ERP5",
"title": "Ticket Type",
"description": result[3][1],
"title": result[3][4],
"default": "",
"items": result[1],
"css_class": "",
......@@ -116,8 +134,8 @@
"type": "ListField"
},
"my_destination_decision": {
"description": "The name of a document in ERP5",
"title": "Current User",
"description": result[3][1],
"title": result[3][5],
"default": result[2],
"css_class": "",
"required": 1,
......@@ -128,7 +146,7 @@
},
"my_specialise": {
"description": "",
"title": "Trade Condition",
"title": result[3][6],
// Auto Set a hardcoded trade Condition
// Please replace it by a getSetting.
"default": "sale_trade_condition_module/slapos_ticket_trade_condition",
......@@ -141,7 +159,7 @@
},
"my_aggregate": {
"description": "",
"title": "Aggregate",
"title": result[3][7],
"default": gadget.state.jio_key,
"css_class": "",
"required": 1,
......@@ -151,8 +169,8 @@
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"description": result[3][1],
"title": result[3][8],
"default": "Support Request",
"css_class": "",
"required": 1,
......@@ -163,7 +181,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][10],
"default": "support_request_module",
"css_class": "",
"required": 1,
......@@ -190,21 +208,21 @@
]]
}
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
return gadget.jio_get(gadget.state.jio_key)
.push(function (doc) {
gadget.updateHeader({
page_title: "New Ticket related to " + doc.title,
selection_url: url_list[0],
submit_action: true
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
return gadget.jio_get(gadget.state.jio_key)
.push(function (doc) {
gadget.updateHeader({
page_title: page_title_translation + " " + doc.title,
selection_url: url_list[0],
submit_action: true
});
});
});
});
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.6873.14525.36027</string> </value>
<value> <string>982.51517.19831.61013</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1575020732.67</float>
<float>1586563897.0</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=New Software Installation created.
data-i18n=The name of a document in ERP5
data-i18n=Software Release to be Installed
data-i18n=Target Computer Title
data-i18n=Target Computer Reference
data-i18n=Computer
data-i18n=Parent Relative Url
data-i18n=Proceed to Supply Software
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.7871.41136.41181</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1509379192.31</float>
<float>1583921451.34</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,8 +16,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -43,7 +42,7 @@
});
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New Software Installation created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -58,24 +57,38 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"New Software Installation created.",
"The name of a document in ERP5",
"Software Release to be Installed",
"Target Computer Title",
"Target Computer Reference",
"Computer",
"Parent Relative Url",
"Proceed to Supply Software"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
gadget.jio_get(options.computer_jio_key)
gadget.jio_get(options.computer_jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[3][0];
page_title_translation = result[3][7];
var doc = result[1],
computer = result[2];
computer = result[2];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_url_string": {
"description": "The name of a document in ERP5",
"title": "Software Release to be Installed",
"description": result[3][1],
"title": result[3][2],
"default": doc.url_string,
"css_class": "",
"required": 0,
......@@ -85,8 +98,8 @@
"type": "StringField"
},
"your_computer_title": {
"description": "The name of a document in ERP5",
"title": "Target Computer Title",
"description": result[3][1],
"title": result[3][3],
"default": computer.title,
"css_class": "",
"required": 0,
......@@ -96,8 +109,8 @@
"type": "StringField"
},
"your_computer_reference": {
"description": "The name of a document in ERP5",
"title": "Target Computer Reference",
"description": result[3][1],
"title": result[3][4],
"default": computer.reference,
"css_class": "",
"required": 0,
......@@ -107,8 +120,8 @@
"type": "StringField"
},
"your_computer": {
"description": "Computer",
"title": "Computer",
"description": result[3][5],
"title": result[3][5],
"default": options.computer_jio_key,
"css_class": "",
"required": 1,
......@@ -119,7 +132,7 @@
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][6],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -140,22 +153,22 @@
group_list: [[
"center",
[["my_url_string"], ["your_computer_title"], ["your_computer_reference"],
["your_computer"], ["my_relative_url"]]
["your_computer"], ["my_relative_url"]]
]]
}
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {"page": "slap_select_software_release"}})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Proceed to Supply Software " + doc.title + " on " + computer.reference,
selection_url: url_list[0],
submit_action: true
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {"page": "slap_select_software_release"}})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: page_title_translation + " " + doc.title + " on " + computer.reference,
selection_url: url_list[0],
submit_action: true
});
});
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.32024.53732.34406</string> </value>
<value> <string>982.32768.34462.32051</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1545952707.91</float>
<float>1584367657.82</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=New Ticket created.
data-i18n=The name of a document in ERP5
data-i18n=Subject
data-i18n=Your Message
data-i18n=Ticket Type
data-i18n=Current User
data-i18n=Trade Condition
data-i18n=Portal Type
data-i18n=Support Request
data-i18n=Parent Relative Url
data-i18n=New Ticket
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.6931.21812.22596</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1574960470.43</float>
<float>1583918242.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,6 +16,7 @@
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -48,7 +49,7 @@
return gadget.jio_post(doc);
})
.push(function (key) {
return gadget.notifySubmitted({message: 'New Ticket created.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -61,9 +62,23 @@
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
.declareMethod("render", function () {
var gadget = this,
page_title_translation,
translation_list = [
"New Ticket created.",
"The name of a document in ERP5",
"Subject",
"Your Message",
"Ticket Type",
"Current User",
"Trade Condition",
"Portal Type",
"Support Request",
"Parent Relative Url",
"New Ticket"
];
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("hateoas_url");
})
......@@ -72,16 +87,20 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_getAttachment("ticket_resource_list",
hateoas_url + "Ticket_getResourceItemListAsJSON"),
window.getSettingMe(gadget)
window.getSettingMe(gadget),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[3][0];
page_title_translation = result[3][10];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Subject",
"description": result[3][1],
"title": result[3][2],
"default": "",
"css_class": "",
"required": 1,
......@@ -92,7 +111,7 @@
},
"my_description": {
"description": "",
"title": "Your Message",
"title": result[3][3],
"default": "",
"css_class": "",
"required": 1,
......@@ -102,8 +121,8 @@
"type": "TextAreaField"
},
"my_resource": {
"description": "The name of a document in ERP5",
"title": "Ticket Type",
"description": result[3][0],
"title": result[3][4],
"default": "",
"items": result[1],
"css_class": "",
......@@ -114,8 +133,8 @@
"type": "ListField"
},
"my_destination_decision": {
"description": "The name of a document in ERP5",
"title": "Current User",
"description": result[3][0],
"title": result[3][5],
"default": result[2],
"css_class": "",
"required": 1,
......@@ -126,7 +145,7 @@
},
"my_specialise": {
"description": "",
"title": "Trade Condition",
"title": result[3][6],
// Auto Set a hardcoded trade Condition
// Please replace it by a getSetting.
"default": "sale_trade_condition_module/slapos_ticket_trade_condition",
......@@ -138,8 +157,8 @@
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"description": result[3][0],
"title": result[3][7],
"default": "Support Request",
"css_class": "",
"required": 1,
......@@ -150,7 +169,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][9],
"default": "support_request_module",
"css_class": "",
"required": 1,
......@@ -180,7 +199,7 @@
})
.push(function () {
return gadget.updateHeader({
page_title: "New Ticket",
page_title: page_title_translation,
        submit_action: true
});
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.7928.37162.44441</string> </value>
<value> <string>983.15147.40197.7321</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1576228705.95</float>
<float>1586991836.89</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=The name of a document in ERP5
data-i18n=Title
data-i18n=Close:
data-i18n=Your Close Message
data-i18n=Include your close message
data-i18n=Source
data-i18n=Follow up
data-i18n=Portal Type
data-i18n=Web Message
data-i18n=Parent Relative Url
data-i18n=Close Ticket
-->
<head>
<meta charset="utf-8">
......
......@@ -276,7 +276,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>975.56900.45728.47581</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -294,7 +294,7 @@
</tuple>
<state>
<tuple>
<float>1558470052.96</float>
<float>1583860746.37</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,7 +14,7 @@
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -51,25 +51,41 @@
})
.declareMethod("render", function (options) {
var gadget = this;
var gadget = this,
page_title_translation,
translation_list = [
"The name of a document in ERP5",
"Title",
"Close:",
"Your Close Message",
"Include your close message",
"Source",
"Follow up",
"Portal Type",
"Web Message",
"Parent Relative Url",
"Close Ticket"
];
gadget.state.jio_key = options.jio_key;
return RSVP.Queue()
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting('me'),
gadget.jio_get(gadget.state.jio_key)
gadget.jio_get(gadget.state.jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
page_title_translation = result[3][10];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "The name of a document in ERP5",
"title": "Title",
"default": "Close: " + result[2].title,
"description": result[3][0],
"title": result[3][1],
"default": result[3][2] + " " + result[2].title,
"css_class": "",
"required": 1,
"editable": 1,
......@@ -78,8 +94,8 @@
"type": "StringField"
},
"my_text_content": {
"description": "Include your close message",
"title": "Your Close Message",
"description": result[3][3],
"title": result[3][4],
"default": "",
"css_class": "",
"required": 1,
......@@ -90,7 +106,7 @@
},
"my_source": {
"description": "",
"title": "Source",
"title": result[3][5],
"default": result[1],
"css_class": "",
"required": 1,
......@@ -101,7 +117,7 @@
},
"my_follow_up": {
"description": "",
"title": "Follow up",
"title": result[3][6],
"default": gadget.state.jio_key,
"css_class": "",
"required": 1,
......@@ -111,8 +127,8 @@
"type": "StringField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"description": result[3][0],
"title": result[3][7],
"default": "Web Message",
"css_class": "",
"required": 1,
......@@ -123,7 +139,7 @@
},
"my_parent_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][9],
"default": "event_module",
"css_class": "",
"required": 1,
......@@ -144,20 +160,20 @@
group_list: [[
"center",
[["my_title"], ["my_text_content"], ["my_follow_up"],
["my_portal_type"], ["my_parent_relative_url"],
["my_follow_up"], ["my_source"]]
["my_portal_type"], ["my_parent_relative_url"],
["my_follow_up"], ["my_source"]]
]]
}
});
})
.push(function () {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Close Ticket",
page_title: page_title_translation,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -272,7 +272,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>975.57171.33951.23705</string> </value>
<value> <string>983.7927.45169.51575</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>1558486456.92</float>
<float>1586564110.31</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Token is Requested.
data-i18n=Parent Relative Url
data-i18n=Command Line to Run
data-i18n=SlapOS Master API
data-i18n=SlapOS Master Web UI
data-i18n=Your Token
data-i18n=Request New Token
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.11766.48122.51046</string> </value>
<value> <string>982.16979.21780.13056</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1509612892.77</float>
<float>1583168466.4</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,6 +15,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -41,7 +42,7 @@
.push(function (result) {
var msg;
if (result) {
msg = 'Token is Requested.';
msg = gadget.msg_translation;
}
return gadget.notifySubmitted({message: msg, status: 'success'})
.push(function () {
......@@ -58,20 +59,33 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Parent Relative Url",
"Command Line to Run",
"SlapOS Master API",
"SlapOS Master Web UI",
"Your Token",
"Request New Token",
"Token is Requested."
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
page_title_translation = result[1][5];
gadget.msg_translation = result[1][6];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[1][0],
"default": "computer_module",
"css_class": "",
"required": 1,
......@@ -82,46 +96,46 @@
},
"my_command_line": {
"description": "",
"title": "Command Line to Run",
"title": result[1][1],
"default": options.command_line,
"css_class": "",
"required": 1,
"editable": 0,
"key": "command_line",
"hidden": (options.access_token === undefined) ? 1: 0,
"hidden": (options.access_token === undefined) ? 1 : 0,
"type": "StringField"
},
"my_slapos_master_api": {
"description": "",
"title": "SlapOS Master API",
"title": result[1][2],
"default": options.slapos_master_api,
"css_class": "",
"required": 1,
"editable": 0,
"key": "slapos_master_api",
"hidden": (options.access_token === undefined) ? 1: 0,
"hidden": (options.access_token === undefined) ? 1 : 0,
"type": "StringField"
},
"my_slapos_master_web": {
"description": "",
"title": "SlapOS Master Web UI",
"title": result[1][3],
"default": options.slapos_master_web,
"css_class": "",
"required": 1,
"editable": 0,
"key": "slapos_master_web",
"hidden": (options.access_token === undefined) ? 1: 0,
"hidden": (options.access_token === undefined) ? 1 : 0,
"type": "StringField"
},
"my_access_token": {
"description": "",
"title": "Your Token",
"title": result[1][4],
"default": options.access_token,
"css_class": "",
"required": 1,
"editable": 0,
"key": "certificate",
"hidden": (options.access_token === undefined) ? 1: 0,
"hidden": (options.access_token === undefined) ? 1 : 0,
"type": "StringField"
}
}},
......@@ -147,7 +161,7 @@
})
.push(function (url_list) {
var header_dict = {
page_title: "Request New Token",
page_title: page_title_translation,
submit_action: true,
selection_url: url_list[0]
};
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.58677.26168.43776</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1554731260.74</float>
<float>1584114795.11</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Title
data-i18n=Reference
data-i18n=Allocation Scope
data-i18n=Status
data-i18n=Servers
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.57354.18371.5888</string> </value>
<value> <string>980.36988.11538.20002</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508415987.5</float>
<float>1581615033.79</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -13,6 +13,7 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
......@@ -57,30 +58,39 @@
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function (options) {
.declareMethod("render", function () {
var gadget = this,
default_strict_allocation_scope_uid,
lines_limit;
lines_limit,
servers_translation,
translation_list = [
"Title",
"Reference",
"Allocation Scope",
"Status",
"Servers"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_list'),
gadget.getSetting("listbox_lines_limit", 20),
gadget.jio_get("portal_categories/allocation_scope/close/forever")
gadget.jio_get("portal_categories/allocation_scope/close/forever"),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
lines_limit = result[0];
default_strict_allocation_scope_uid = result[1].uid;
return gadget.getDeclaredGadget('form_list');
})
.push(function (form_list) {
var column_list = [
['title', 'Title'],
['reference', 'Reference'],
['allocation_scope_title', 'Allocation Scope'],
['Computer_getNewsDict', 'Status']
];
['title', result[3][0]],
['reference', result[3][1]],
['allocation_scope_title', result[3][2]],
['Computer_getNewsDict', result[3][3]]
],
form_list = result[0];
lines_limit = result[1];
default_strict_allocation_scope_uid = result[2].uid;
servers_translation = result[3][4];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -99,7 +109,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["title", "ascending"]],
"title": "Servers",
"title": servers_translation,
"type": "ListBox"
}
}},
......@@ -123,7 +133,7 @@
jio_key: "computer_module"
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "slap_add_computer"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_computer_get_token"}}),
......@@ -133,7 +143,7 @@
})
.push(function (result) {
return gadget.updateHeader({
page_title: "Servers",
page_title: servers_translation,
token_url: result[1],
selection_url: result[2],
filter_action: true,
......
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.61498.11899.44253</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1554901061.9</float>
<float>1584114657.24</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Data updated.
data-i18n=Title
data-i18n=Reference
data-i18n=Allocation Scope
data-i18n=Status
data-i18n=Monitoring Status
data-i18n=The name of a document in ERP5
data-i18n=Current Project
data-i18n=Current Organisation
data-i18n=Associated Servers
data-i18n=Computer Network:
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.63245.49193.13909</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508769478.58</float>
<float>1583859709.48</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, Blob */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, jIO, Blob) {
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
......@@ -16,6 +16,7 @@
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -25,10 +26,9 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, value_jio_key, len = result.data.total_rows;
var i, value, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("Computer_getNewsDict"))) {
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.Computer_getNewsDict;
result.data.rows[i].value.Computer_getNewsDict = {
field_gadget_param : {
......@@ -38,7 +38,7 @@
"default": {jio_key: value, result: value},
key: "status",
url: "gadget_slapos_computer_status.html",
title: "Status",
title: gadget.title_translation,
type: "GadgetField"
}
};
......@@ -73,7 +73,7 @@
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data updated.', status: 'success'});
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'});
});
})
......@@ -82,25 +82,45 @@
})
.onStateChange(function () {
var gadget = this, data;
var gadget = this,
page_title_translation,
translation_list = [
"Data updated.",
"Title",
"Reference",
"Allocation Scope",
"Status",
"Monitoring Status",
"The name of a document in ERP5",
"Current Project",
"Current Organisation",
"Associated Servers",
"Computer Network"
];
return new RSVP.Queue()
.push(function () {
return gadget.getDeclaredGadget('form_view');
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (form_gadget) {
var editable = gadget.state.editable;
var column_list = [
['title', 'Title'],
['reference', 'Reference'],
['allocation_scope_translated_title', 'Allocation Scope'],
['Computer_getNewsDict', 'Status']
];
return form_gadget.render({
.push(function (result) {
gadget.title_translation = result[1][4];
gadget.message_translation = result[1][0];
page_title_translation = result[1][10];
var editable = gadget.state.editable,
column_list = [
['title', result[1][1]],
['reference', result[1][2]],
['allocation_scope_translated_title', result[1][3]],
['Computer_getNewsDict', result[1][4]]
];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"title": result[1][1],
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
......@@ -111,7 +131,7 @@
},
"my_reference": {
"description": "",
"title": "Reference",
"title": result[1][2],
"default": gadget.state.doc.reference,
"css_class": "",
"required": 1,
......@@ -123,7 +143,7 @@
"my_monitoring_status": {
"description": "",
"title": "Monitoring Status",
"title": result[1][5],
"default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news},
"css_class": "",
......@@ -136,8 +156,8 @@
"type": "GadgetField"
},
"my_source_project": {
"description": "The name of a document in ERP5",
"title": "Current Project",
"description": result[1][6],
"title": result[1][7],
"default": gadget.state.doc.source_project_title,
"css_class": "",
"required": 0,
......@@ -147,8 +167,8 @@
"type": "StringField"
},
"my_source_section": {
"description": "The name of a document in ERP5",
"title": "Current Organisation",
"description": result[1][6],
"title": result[1][8],
"default": gadget.state.doc.source_section_title,
"css_class": "",
"required": 1,
......@@ -174,7 +194,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["title", "ascending"]],
"title": "Associated Servers",
"title": result[1][9],
"type": "ListBox"
}
}},
......@@ -210,7 +230,7 @@
.push(function (url_list) {
var header_dict = {
selection_url: url_list[1],
page_title: "Computer Network :" + gadget.state.doc.title,
page_title: page_title_translation + " :" + gadget.state.doc.title,
delete_url: url_list[2],
transfer_url: url_list[3],
save_action: true
......@@ -221,4 +241,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP, jIO, Blob));
\ No newline at end of file
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.63062.57955.57890</string> </value>
<value> <string>982.32757.36066.20889</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1562685619.84</float>
<float>1584353041.46</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Certificate is Revoked.
data-i18n=This computer already has one certificate, please revoke it before request a new one..
data-i18n=Parent Relative Url
data-i18n=Your Certificate
data-i18n=Your Key
data-i18n=Request New Certificate
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9164.44540.8960</string> </value>
<value> <string>982.31368.56497.11929</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1509456785.59</float>
<float>1584554363.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,6 +15,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -41,9 +42,9 @@
.push(function (result) {
var msg;
if (result) {
msg = 'Certificate is Requested.';
msg = gadget.msg1_translation;
} else {
msg = 'This computer already has one certificate, please revoke it before request a new one..';
msg = gadget.msg2_translation;
result = {};
}
return gadget.notifySubmitted({message: msg, status: 'success'})
......@@ -61,20 +62,33 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Certificate is Requested.",
"This computer already has one certificate, please revoke it before request a new one..",
"Parent Relative Url",
"Your Certificate",
"Your Key",
"Request New Certificate"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.msg1_translation = result[1][0];
gadget.msg2_translation = result[1][1];
page_title_translation = result[1][5];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[1][2],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -85,24 +99,24 @@
},
"my_certificate": {
"description": "",
"title": "Your Certificate",
"title": result[1][3],
"default": options.certificate,
"css_class": "",
"required": 1,
"editable": 1,
"key": "certificate",
"hidden": (options.certificate === undefined) ? 1: 0,
"hidden": (options.certificate === undefined) ? 1 : 0,
"type": "TextAreaField"
},
"my_key": {
"description": "",
"title": "Your Key",
"title": result[1][4],
"default": options.key,
"css_class": "",
"required": 1,
"editable": 1,
"key": "key",
"hidden": (options.key === undefined) ? 1: 0,
"hidden": (options.key === undefined) ? 1 : 0,
"type": "TextAreaField"
}
}},
......@@ -121,14 +135,14 @@
}
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: "slap_controller"}})
]);
})
.push(function (url_list) {
var header_dict = {
page_title: "Request New Certificate",
page_title: page_title_translation,
submit_action: true,
selection_url: url_list[0]
};
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9426.27532.17049</string> </value>
<value> <string>982.40087.16458.63778</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1523382684.29</float>
<float>1584561214.84</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Certificate is Revoked.
data-i18n=This computer has no certificate to revoke.
data-i18n=Parent Relative Url
data-i18n=Revoke Computer Certificate
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9165.23441.63180</string> </value>
<value> <string>982.28459.17346.12800</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1509456833.14</float>
<float>1583856774.13</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,6 +15,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -42,9 +43,9 @@
.push(function (result) {
var msg;
if (result) {
msg = 'Certificate is Revoked.';
msg = gadget.msg1_translation;
} else {
msg = 'This computer has no certificate to revoke.';
msg = gadget.msg2_translation;
}
return gadget.notifySubmitted({message: msg, status: 'success'})
.push(function () {
......@@ -60,20 +61,31 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Certificate is Revoked.",
"This computer has no certificate to revoke.",
"Parent Relative Url",
"Revoke Computer Certificate"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.msg1_translation = result[1][0];
gadget.msg2_translation = result[1][1];
page_title_translation = result[1][3];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[1][2],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -98,14 +110,14 @@
}
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Revoke Computer Certificate",
page_title: page_title_translation,
submit_action: true,
selection_url: url_list[0]
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9426.27532.17049</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1523382738.86</float>
<float>1584114242.8</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Data updated.
data-i18n=Software Release
data-i18n=Url
data-i18n=Status
data-i18n=Title
data-i18n=Reference
data-i18n=Modification Date
data-i18n=State
data-i18n=Enabled
data-i18n=Disabled
data-i18n=Auto Upgrade
data-i18n=Ask Confirmation before Upgrade
data-i18n=Never Upgrade
data-i18n=Closed for maintenance
data-i18n=Closed for termination
data-i18n=Closed forever
data-i18n=Closed outdated
data-i18n=Open for Friends only
data-i18n=Open for Personal use only
data-i18n=Open Public
data-i18n=Open for Subscribers only
data-i18n=Network
data-i18n=Allocation Scope
data-i18n=Monitoring
data-i18n=Your Friends email
data-i18n=Upgrade
data-i18n=The name of a document in ERP5
data-i18n=Current Site
data-i18n=Current Project
data-i18n=Monitoring Status
data-i18n=Supplied Softwares
data-i18n=Computer:
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.712.57271.37478</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508949660.76</float>
<float>1583944820.18</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,6 +16,7 @@
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -72,7 +73,7 @@
});
})
.push(function () {
return gadget.notifySubmitted({message: 'Data updated.', status: 'success'});
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'});
});
})
......@@ -81,7 +82,43 @@
})
.declareMethod("render", function (options) {
var gadget = this;
var gadget = this,
page_title_translation,
translation_list = [
"Data updated.",
"Software Release",
"Url",
"Status",
"Title",
"Reference",
"Modification Date",
"State",
"Enabled",
"Disabled",
"Auto Upgrade",
"Ask Confirmation before Upgrade",
"Never Upgrade",
"Closed for maintenance",
"Closed for termination",
"Closed forever",
"Closed outdated",
"Open for Friends only",
"Open for Personal use only",
"Open Public",
"Open for Subscribers only",
"Network",
"Allocation Scope",
"Monitoring",
"Your Friends email",
"Upgrade",
"The name of a document in ERP5",
"Current Site",
"Current Project",
"Monitoring Status",
"Supplied Softwares",
"Computer:"
];
// Follow up changeState API but it is requires to actually
// re-render the form to hide allocation scope
gadget.state = {
......@@ -97,39 +134,42 @@
query: '(portal_type:"Computer Network")',
sort_on: [['reference', 'ascending']],
select_list: ['reference', 'title']
})
}),
gadget.getTranslationList(translation_list)
]);
})
.push(function (results) {
gadget.message_translation = results[2][0];
page_title_translation = results[2][31];
var form_gadget = results[0],
computer_network_list = [["", ""]],
column_list = [
['SoftwareInstallation_getSoftwareReleaseInformation', 'Software Release'],
['url_string', 'Url'],
['SoftwareInstallation_getNewsDict', 'Status']
['SoftwareInstallation_getSoftwareReleaseInformation', results[2][1]],
['url_string', results[2][2]],
['SoftwareInstallation_getNewsDict', results[2][3]]
],
ticket_column_list = [
['title', 'Title'],
['reference', 'Reference'],
['modification_date', 'Modification Date'],
['translated_simulation_state_title', 'State']
['title', results[2][4]],
['reference', results[2][5]],
['modification_date', results[2][6]],
['translated_simulation_state_title', results[2][7]]
],
monitor_scope_list = [['', ''],
['Enabled', 'enabled'],
['Disabled', 'disabled']],
[results[2][8], 'enabled'],
[results[2][9], 'disabled']],
upgrade_scope_list = [['', ''],
['Auto Upgrade', 'auto'],
['Ask Confirmation before Upgrade', 'ask_confirmation'],
['Never Upgrade', 'never']],
[results[2][10], 'auto'],
[results[2][11], 'ask_confirmation'],
[results[2][12], 'never']],
allocation_scope_list = [['', ''],
['Closed for maintenance', 'close/maintenance'],
['Closed for termination', 'close/termination'],
['Closed forever', 'close/forever'],
['Closed oudated', 'close/outdated'],
['Open for Friends only', 'open/friend'],
['Open for Personal use only', 'open/personal'],
['Open Public', 'open/public'],
['Open for Subscribers only', 'open/subscription']],
[results[2][13], 'close/maintenance'],
[results[2][14], 'close/termination'],
[results[2][15], 'close/forever'],
[results[2][16], 'close/outdated'],
[results[2][17], 'open/friend'],
[results[2][18], 'open/personal'],
[results[2][19], 'open/public'],
[results[2][20], 'open/subscription']],
i,
len = results[1].data.total_rows;
......@@ -146,7 +186,7 @@
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"title": results[2][4],
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
......@@ -157,7 +197,7 @@
},
"my_reference": {
"description": "",
"title": "Reference",
"title": results[2][5],
"default": gadget.state.doc.reference,
"css_class": "",
"required": 1,
......@@ -168,7 +208,7 @@
},
"my_subordination": {
"description": "",
"title": "Network",
"title": results[2][21],
"default": gadget.state.doc.subordination,
"css_class": "",
"items": computer_network_list,
......@@ -180,7 +220,7 @@
},
"my_allocation_scope": {
"description": "",
"title": "Allocation Scope",
"title": results[2][22],
"default": gadget.state.doc.allocation_scope,
"css_class": "",
"items": allocation_scope_list,
......@@ -192,7 +232,7 @@
},
"my_monitor_scope": {
"description": "",
"title": "Monitoring",
"title": results[2][23],
"default": gadget.state.doc.monitor_scope,
"css_class": "",
"items": monitor_scope_list,
......@@ -204,7 +244,7 @@
},
"my_subject_list": {
"description": "",
"title": "Your Friends email",
"title": results[2][24],
"default": gadget.state.doc.subject_list,
"css_class": "",
"required": 1,
......@@ -215,7 +255,7 @@
},
"my_upgrade_scope": {
"description": "",
"title": "Upgrade",
"title": results[2][25],
"default": gadget.state.doc.upgrade_scope,
"css_class": "",
"items": upgrade_scope_list,
......@@ -226,8 +266,8 @@
"type": "ListField"
},
"my_source": {
"description": "The name of a document in ERP5",
"title": "Current Site",
"description": results[2][26],
"title": results[2][27],
"default": gadget.state.doc.source_title,
"css_class": "",
"required": 1,
......@@ -237,8 +277,8 @@
"type": "StringField"
},
"my_source_project": {
"description": "The name of a document in ERP5",
"title": "Current Project",
"description": results[2][26],
"title": results[2][28],
"default": gadget.state.doc.source_project_title,
"css_class": "",
"required": 1,
......@@ -249,7 +289,7 @@
},
"my_monitoring_status": {
"description": "",
"title": "Monitoring Status",
"title": results[2][29],
"default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news},
"css_class": "",
......@@ -277,7 +317,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["title", "ascending"]],
"title": "Supplied Softwares",
"title": results[2][30],
"type": "ListBox"
},
"ticket_listbox": {
......@@ -339,7 +379,7 @@
})
.push(function (url_list) {
var header_dict = {
page_title: "Computer: " + gadget.state.doc.title,
page_title: page_title_translation + " " + gadget.state.doc.title,
ticket_url: url_list[1],
supply_url: url_list[2],
request_certificate_url: url_list[3],
......
......@@ -258,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.36756.24043.65297</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -276,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1568971483.48</float>
<float>1584116948.47</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -69,10 +69,21 @@
} else if ((result.portal_type === "Organisation") &&
result.role === "host") {
child_gadget_url = "gadget_erp5_page_slap_site_view.html";
} else if (result.portal_type !== undefined) {
} else if ((result.portal_type === "组织") &&
result.role === "host") {
child_gadget_url = "gadget_erp5_page_slap_site_view.html";
} else if (result.portal_type === "ERP5 Login") {
child_gadget_url = 'gadget_erp5_page_slap_' +
result.portal_type.replace(/ /g, '_').toLowerCase() +
'_view.html';
} else if (result.portal_type === "access_denied") {
child_gadget_url = 'gadget_erp5_page_slap_' +
result.portal_type.replace(/ /g, '_').toLowerCase() +
'_view.html';
} else if (result.portal_type !== undefined) {
child_gadget_url = 'gadget_erp5_page_slap_' +
result.parent_relative_url.replace(/_module/g, '').toLowerCase() +
'_view.html';
} else {
throw new Error('Can not display document: ' + options.jio_key);
}
......
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.35642.57629.14574</string> </value>
<value> <string>983.16079.39534.2440</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1576597179.41</float>
<float>1587053604.03</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Network to be removed:
data-i18n=Warning
data-i18n=You cannot delete this object because you have associated Computers and/or services.
data-i18n=Parent Relative Url
data-i18n=Delete Network:
data-i18n=Network is Deleted.
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.2957.49699.64750</string> </value>
<value> <string>982.18033.65391.20155</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1520535274.05</float>
<float>1583231248.98</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -17,6 +17,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -42,7 +43,7 @@
});
})
.push(function () {
return gadget.notifySubmitted({message: 'Network is Deleted.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -56,8 +57,17 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Network to be removed:",
"Warning",
"You cannot delete this object because you have associated Computers and/or services.",
"Parent Relative Url",
"Delete Network:",
"Network is Deleted."
];
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("hateoas_url")
.push(function (url) {
......@@ -65,19 +75,22 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
gadget.jio_getAttachment(options.jio_key,
url + options.jio_key + "/ComputerNetwork_hasComputer")
url + options.jio_key + "/ComputerNetwork_hasComputer"),
gadget.getTranslationList(translation_list)
]);
});
})
.push(function (result) {
options.doc = result[1];
options.can_delete = result[2] ? 0: 1;
options.can_delete = result[2] ? 0 : 1;
page_title_translation = result[3][4];
gadget.message_translation = result[3][5];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Network to be removed: ",
"title": result[3][0],
"default": options.doc.title,
"css_class": "",
"required": 1,
......@@ -88,8 +101,8 @@
},
"message": {
"description": "",
"title": "Warning",
"default": "You cannot delete this object because you have associated Computers and/or services.",
"title": result[3][1],
"default": result[3][2],
"css_class": "",
"required": 1,
"editable": 0,
......@@ -99,7 +112,7 @@
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][3],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -136,7 +149,7 @@
.push(function (result) {
var header_dict = {
selection_url: result[1],
page_title: "Delete Network: " + options.doc.title
page_title: page_title_translation + " " + options.doc.title
};
if (options.can_delete) {
header_dict.submit_action = true;
......
......@@ -285,7 +285,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.41526.6603.40089</string> </value>
<value> <string>983.14689.25818.18193</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1523031853.32</float>
<float>1586962654.58</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Site is Deleted.
data-i18n=Organisation to be removed:
data-i18n=Warning
data-i18n=You cannot delete this object because you have associated Computers and/or services.
data-i18n=Parent Relative Url
data-i18n=Delete Site:
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.2891.38823.26197</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1520531273.77</float>
<float>1583854185.74</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -17,6 +17,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -42,7 +43,7 @@
});
})
.push(function () {
return gadget.notifySubmitted({message: 'Site is Deleted.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -56,8 +57,17 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Site is Deleted.",
"Organisation to be removed:",
"Warning",
"You cannot delete this object because you have associated Computers and/or services.",
"Parent Relative Url",
"Delete Site:"
];
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("hateoas_url")
.push(function (url) {
......@@ -65,19 +75,22 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
gadget.jio_getAttachment(options.jio_key,
url + options.jio_key + "/Organisation_hasItem")
url + options.jio_key + "/Organisation_hasItem"),
gadget.getTranslationList(translation_list)
]);
});
})
.push(function (result) {
options.doc = result[1];
options.can_delete = result[2] ? 0: 1;
options.can_delete = result[2] ? 0 : 1;
gadget.message_translation = result[3][0];
page_title_translation = result[3][5];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Organisation to be removed: ",
"title": result[3][1],
"default": options.doc.title,
"css_class": "",
"required": 1,
......@@ -88,8 +101,8 @@
},
"message": {
"description": "",
"title": "Warning",
"default": "You cannot delete this object because you have associated Computers and/or services.",
"title": result[3][2],
"default": result[3][3],
"css_class": "",
"required": 1,
"editable": 0,
......@@ -99,7 +112,7 @@
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][4],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -136,7 +149,7 @@
.push(function (result) {
var header_dict = {
selection_url: result[1],
page_title: "Delete Site: " + options.doc.title
page_title: page_title_translation + " " + options.doc.title
};
if (options.can_delete) {
header_dict.submit_action = true;
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.2904.41210.62225</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1520532936.78</float>
<float>1584113928.49</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Project is Deleted.
data-i18n=Project to be removed:
data-i18n=Warning
data-i18n=You cannot delete this object because you have associated Computers and/or services.
data-i18n=Parent Relative Url
data-i18n=Delete Project:
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.1457.18004.58248</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1520445208.94</float>
<float>1583853282.49</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -17,6 +17,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -42,7 +43,7 @@
});
})
.push(function () {
return gadget.notifySubmitted({message: 'Project is Deleted.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -56,8 +57,17 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Project is Deleted.",
"Project to be removed:",
"Warning",
"You cannot delete this object because you have associated Computers and/or services.",
"Parent Relative Url",
"Delete Project:"
];
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("hateoas_url")
.push(function (url) {
......@@ -65,19 +75,22 @@
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key),
gadget.jio_getAttachment(options.jio_key,
url + options.jio_key + "/Project_hasItem")
url + options.jio_key + "/Project_hasItem"),
gadget.getTranslationList(translation_list)
]);
});
})
.push(function (result) {
options.doc = result[1];
options.can_delete = result[2] ? 0: 1;
options.can_delete = result[2] ? 0 : 1;
gadget.message_translation = result[3][0];
page_title_translation = result[3][5];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Project to be removed: ",
"title": result[3][1] + " ",
"default": options.doc.title,
"css_class": "",
"required": 1,
......@@ -88,8 +101,8 @@
},
"message": {
"description": "",
"title": "Warning",
"default": "You cannot delete this object because you have associated Computers and/or services.",
"title": result[3][2],
"default": result[3][3],
"css_class": "",
"required": 1,
"editable": 0,
......@@ -99,7 +112,7 @@
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[3][4],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -136,7 +149,7 @@
.push(function (result) {
var header_dict = {
selection_url: result[1],
page_title: "Delete Project: " + options.doc.title
page_title: page_title_translation + " " + options.doc.title
};
if (options.can_delete) {
header_dict.submit_action = true;
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.1507.43744.63266</string> </value>
<value> <string>982.32745.35202.3976</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1520532906.01</float>
<float>1584369363.83</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=Service is Destroyed.
data-i18n=Instance to be removed:
data-i18n=Parent Relative Url
data-i18n=Destroy Hosting Subscription:
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.23615.23870.11912</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1518101743.13</float>
<float>1583850872.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,6 +16,7 @@
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -41,7 +42,7 @@
});
})
.push(function () {
return gadget.notifySubmitted({message: 'Service is Destroyed.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -55,22 +56,32 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"Service is Destroyed.",
"Instance to be removed:",
"Parent Relative Url",
"Destroy Hosting Subscription:"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.jio_get(options.jio_key)
gadget.jio_get(options.jio_key),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
options.doc = result[1];
gadget.message_translation = result[2][0];
page_title_translation = result[2][3];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Instance to be removed: ",
"title": result[2][1] + " ",
"default": options.doc.title,
"css_class": "",
"required": 1,
......@@ -81,7 +92,7 @@
},
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[2][2],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -116,7 +127,7 @@
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Destroy Hosting Subscription: " + options.doc.title,
page_title: page_title_translation + " " + options.doc.title,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.64412.55419.5376</string> </value>
<value> <string>982.32516.46874.3959</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1522141323.61</float>
<float>1584113435.94</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<!--
data-i18n=You sucessfully request destruction.
data-i18n=Parent Relative Url
data-i18n=Destroy Software Installation
-->
<head>
<meta charset="utf-8">
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.7938.62977.38690</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1509383232.18</float>
<float>1583849176.73</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,7 +15,7 @@
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -41,7 +41,7 @@
});
})
.push(function () {
return gadget.notifySubmitted({message: 'You sucessfully request destruction.', status: 'success'})
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
......@@ -55,20 +55,29 @@
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
var gadget = this,
page_title_translation,
translation_list = [
"You sucessfully request destruction.",
"Parent Relative Url",
"Destroy Software Installation"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view')
gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
gadget.message_translation = result[1][0];
page_title_translation = result[1][2];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_relative_url": {
"description": "",
"title": "Parent Relative Url",
"title": result[1][1],
"default": options.jio_key,
"css_class": "",
"required": 1,
......@@ -100,7 +109,7 @@
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Destroy Software Installation",
page_title: page_title_translation,
selection_url: url_list[0],
submit_action: true
});
......
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.32024.53732.34406</string> </value>
<value> <string>982.32733.10195.41062</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>1545996559.57</float>
<float>1584113156.56</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Password is different from confirmation
data-i18n=Data updated.
data-i18n=Reference
data-i18n=Password
data-i18n=Confirm your Password
data-i18n=Login:
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.25799.53789.3635</string> </value>
<value> <string>982.16656.9604.44475</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1537461597.76</float>
<float>1583847426.0</float>
<string>UTC</string>
</tuple>
</state>
......
This diff is collapsed.
This diff is collapsed.
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