Commit ea6e3d83 authored by Peter Walter's avatar Peter Walter
Browse files

version 2.1

parent ecfceb9e
......@@ -12,7 +12,7 @@
// ==/UserScript==
var info = {};
info['version'] = '2.0';
info['version'] = '2.1';
if (document.location.pathname.indexOf('extserv') !== -1) {
info['path'] = '/extserv';
info['domain'] = 'https://rt.ebi.ac.uk';
......@@ -188,12 +188,12 @@ function getModifyLink(commands) {
if (typeof commands === 'object') {
for(var key in commands) {
if (key && commands[key]) {
arg += "&" + key.toString().trim() + "=" + commands[key].toString().trim();
arg += "&" + key.toString().trim() + "=" + encodeURIComponent(commands[key].toString().trim());
}
}
}
return getElementText('div#page-navigation a#page-basics', 'href') + arg;
return getElementText('div#page-navigation a#page-basics', 'href') + arg;
}
/**
......@@ -345,14 +345,25 @@ function getCustomFields(cfId) {
var temp = document.createElement('div');
temp.innerHTML = response.responseText;
var cfOptions = temp.querySelectorAll('select[name="Object-RT::Ticket-' + getTicketId() + '-CustomField-' + cfId + '-Values"] *');
var optGroup = 'Default';
var optValue = '';
var cfOptions = temp.querySelectorAll('select[name="Object-RT::Ticket-' + getTicketId() + '-CustomField-' + cfId + '-Values"] *');
for (var cfOption in cfOptions) {
if (cfOptions[cfOption].tagName === "OPTGROUP") {
var optGroup = cfOptions[cfOption].label;
optGroup = cfOptions[cfOption].label;
}
if (cfOptions[cfOption].tagName === "OPTION") {
var optValue = cfOptions[cfOption].value;
optValue = cfOptions[cfOption].value;
if (optValue) {
customFields[optGroup + '-' + optValue] = optValue;
customFieldsString += optGroup + '-' + optValue + ':' + optValue + ';';
}
}
}
var cfComboOptions = temp.querySelectorAll('select[name="List-Object-RT::Ticket-' + getTicketId() + '-CustomField-' + cfId + '-Value"] *');
for (var cfComboOption in cfComboOptions) {
if (cfComboOptions[cfComboOption].tagName === "OPTION") {
optValue = cfComboOptions[cfComboOption].value;
if (optValue) {
customFields[optGroup + '-' + optValue] = optValue;
customFieldsString += optGroup + '-' + optValue + ':' + optValue + ';';
......@@ -1123,5 +1134,4 @@ try {
}
catch(err) {
console.log(err.message);
}
}
\ No newline at end of file
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