Commit a4add18b authored by Sandeep Kadam's avatar Sandeep Kadam
Browse files

Added more fixes to show selected custom field & queues

parent d17219cb
...@@ -141,7 +141,7 @@ function getName(full) { ...@@ -141,7 +141,7 @@ function getName(full) {
* @return String, eg "Web Development" * @return String, eg "Web Development"
*/ */
function getQueue() { function getQueue() {
return getElementText('div.ticket-info-basics div.queue div.value').split('\n')[0]; return getElementText('div.ticket-info-basics div.queue span.current-value', 'text').split('\n')[0];
} }
/** /**
...@@ -149,7 +149,7 @@ function getQueue() { ...@@ -149,7 +149,7 @@ function getQueue() {
* @return String, eg * @return String, eg
*/ */
function getOwner() { function getOwner() {
var owner=getElementText('div.ticket-info-people div.value', 'text').split('\n')[0]; var owner=getElementText('div.ticket-info-people span.current-value', 'text').split('\n')[0];
if (owner.indexOf('(') !== -1) { if (owner.indexOf('(') !== -1) {
owner=/\((.*)\)/gi.exec(owner)[1]; owner=/\((.*)\)/gi.exec(owner)[1];
} }
...@@ -161,7 +161,8 @@ function getOwner() { ...@@ -161,7 +161,8 @@ function getOwner() {
* @return String * @return String
*/ */
function getCustomField(id) { function getCustomField(id) {
return getElementText('div.ticket-info-cfs div.custom-field div#CF-' + id + '-ShowRow div.value', 'text').split('\n',1)[0]; var field_val = getElementText('div#CF-' + id + '-ShowRow span.current-value', 'text').split('\n',1)[0];
return field_val;
} }
/** /**
...@@ -488,6 +489,7 @@ function init() { ...@@ -488,6 +489,7 @@ function init() {
var queues = getQueues(); var queues = getQueues();
var queue; var queue;
container = document.querySelector('div.ticket-info-basics div.queue div.value'); container = document.querySelector('div.ticket-info-basics div.queue div.value');
if (!container) { if (!container) {
return; return;
} }
...@@ -893,8 +895,6 @@ function init() { ...@@ -893,8 +895,6 @@ function init() {
var temp = document.createElement('div'); var temp = document.createElement('div');
temp.innerHTML = response.responseText; temp.innerHTML = response.responseText;
setValue('name', temp.querySelector('div.RealName span.value').innerHTML);
var queueOptions = temp.querySelectorAll('select[name="Queue"] option'); var queueOptions = temp.querySelectorAll('select[name="Queue"] option');
for (var queueOption in queueOptions) { for (var queueOption in queueOptions) {
if (queueOptions[queueOption].value && queueOptions[queueOption].text) { if (queueOptions[queueOption].value && queueOptions[queueOption].text) {
......
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