// ==UserScript==
// @name ITSM+
// @description ITSM+ Helsinki release update
// @namespace neemspeesweetikveel
// @icon http://www.mouserunner.net/free_icons/Orbs/Orbs_Preview_I.png
// @version 1.906
// @include https://dimensiondatasandbox.service-now.com/*
// @include https://support.emc.com/servicecenter/createSR/*
// @include https://support.infoblox.com/app/ask*
// @include https://casemanager.juniper.net/casemanager/*
// @include https://tools.cisco.com/ServiceRequestTool/scm/mgmt/*
// @include https://*cloudapps.cisco.com/*
// @include https://*.salesforce.com/*
// @include https://*.ntt.eu/*
// @include https://*.fortinet.com/*
// @include http://eservice.evercom.be/*
// @include http*://scram.client.eu.didata.local/*
// @include https://moveit.dimensiondata.com/*
// @include https://usercenter.checkpoint.com/usercenter/portal/media-type/html/role/usercenterUser/page/default.psml/js_pane/*
// @include https://websupport.f5.com/casemanager/*
// @include https://meetings-eu.dimensiondata.com/orion/meeting/schedule*
// @include https://meetings-eu.dimensiondata.com/orion/joinmeeting.do
// @include *wired.dimensiondata.com/communities/eu/be.belgium/Lists/*
// @include http://eubebruphpbb/phpbb3_1/*
// @include *wired.dimensiondata.com/communities/eu/be.belgium/Lists/Cust/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @resource jabbericon https://lh5.ggpht.com/8SJwWIlSqvTU_zBEOht4diByqRNgzGlVNh0qlv8B69cm1qevWgDGTx5DRb8s_0-EtaW8=w300
// @resource lyncicon https://cdn2.iconfinder.com/data/icons/metro-uinvert-dock/256/Lync.png
// @resource sharepicon http://icons.iconarchive.com/icons/dakirby309/simply-styled/128/Microsoft-SharePoint-2013-icon.png
// @resource phpbbsicon http://icons.iconarchive.com/icons/tatice/cristal-intense/128/PhpBB-icon.png
// @grant unsafeWindow
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant GM_listValues
// @grant GM_log
// @grant GM_getResourceURL
// ==/UserScript==
// https://meetings-eu.dimensiondata.com/orion/joinmeeting.do
// https://dimensiondataservices.service-now.com/images/nav_forward.gifx
// https://dimensiondataservices.service-now.com/images/nav_backward.gifx
// @require http://findicons.com/files/icons/2181/34al_volume_3_2_se/24/001_46.png
// @require http://findicons.com/files/icons/39/aqcua/32/online.png
// @resource jabbericon http://static1.squarespace.com/static/5357f5d5e4b0e0474a40a6cf/5373d791e4b0b339e9db0a49/5469e622e4b0bff63b7aa21a/1416226441513/Jabber-logo-2014.png?format=50w
// // @resource jabbericon http://www.adiumxtras.com/images/thumbs/gaim_service_icons_contact_list_styles_12031889_thumb.png
// // @run-at document-idle
var timer0 = new Date();
var timer1 = new Date();
var timer2 = new Date();
var timer3 = new Date();
var timer4 = new Date();
var timer5 = new Date();
var timer6 = new Date();
var whatsnew = 'Script now shows when a SWOW ETA has expired by coloring the case \'Short Description\' field in the tasklist' // ver 1.167
var whatsnew = 'Taking us straight to our tasklist. Fixed bug in sla list'; // ver 1.168
var whatsnew = 'Adding status tags to swow for Pending Customer,Pending Vendor,Pending Contracts/Admin,Other'; // ver 1.169
var whatsnew = 'Shorter message in custom text 2'; // ver 1.170
var whatsnew = 'Add dates to custom date 1 (last update) custom date 1 (eta swow)'; // ver 1.171
var whatsnew = 'Delay on setting homepage. '; // ver 1.172
var whatsnew = ''; // ver 1.17x
var whatsnew = 'Debug for swow button not showing swow window.'; // ver 1.174
var whatsnew = 'Debug for swow button moved to plus button.'; // ver 1.175
var whatsnew = 'ETA date to next year fixed.'; // ver 1.176
var whatsnew = 'debugs, debugs '; // ver 1.177
var whatsnew = 'Allow to add to case: Product, version, Serial, Contract. It is likely to be usefull especially when all other CI info is virtual. Selecting (in found or elsewhere,) will copy selected text to field.'; // ver 1.178
var whatsnew = 'Trying to get the products serials, when they are present in ITSM (Not when virtual),\nWarn for no SWOW entry.';// ver 1.179
var whatsnew = 'New no SWOW warning. ETA Today is now + 2 hours.'; // ver 1.180
var whatsnew = 'Fix for click on link in ITSM mail.'; // ver 1.181
var whatsnew = 'Remove some testing code.'; // ver 1.182
var whatsnew = 'No child SVR\'s/ICM\'s in tasklist'; // ver 1.183
var whatsnew = 'Strickter SWOW hilite using task type Request or Incident'; // ver 1.185
var whatsnew = 'Bug fixed in Strickter SWOW hilite using task type Request or Incident'; // ver 1.186
var whatsnew = 'Supported case types are now Request, Incident, Problem or Change '; // ver 1.187
var whatsnew = 'Links to sharepoint and NOC forum (Still thinking how to improve this), better \'Configure actions Screen\' '; // ver 1.188
var whatsnew = 'Better links to sharepoint and NOC forum (Still thinking how to improve this)'; // ver 1.189
var whatsnew = 'SWOW bugske Thanks Massimo!!'; // ver 1.190
var whatsnew = 'Added Evercom vendor basic'; // ver 1.191
var whatsnew = 'Better links to sharepoint and NOC forum II (Still thinking how to improve this)'; // ver 1.192
var whatsnew = 'Better links to sharepoint and NOC forum III (Still thinking how to improve this) Evercom vendor almost complete'; // ver 1.193
var whatsnew = 'Fixed issue with "Comments Actions" editing, increased visibility of backlog cases. '; // ver 1.194
var whatsnew = 'Top layout & navigation menu improvements. ( less screenspace wasted ) '; // ver 1.196
var whatsnew = 'It is Instant message time in ITSM\nNot sure why I waited so long to add this but now it is there.\nMessages can be sent using Jabber or Lync.\nIt might be required to associate the protocol with the application first. '; // ver 1.198
var whatsnew = 'Vendor F5 and Checkpoint added to ITSM+.No case nr detection yet '; // ver 1.199
var whatsnew = 'Bug with calendar for ETA in march '; // ver 1.200
var whatsnew = 'Fix for Button Home Print etc,.. '; // ver 1.201
var whatsnew = 'Adjusted buttons in top frame'; // ver 1.202
var whatsnew = 'Acceptance expiry time field visible now that it might be used '; // ver 1.203
var whatsnew = 'More TP vendors under ITSM+ tab '; // ver 1.204
var whatsnew = 'Reject script no more called fix'; // ver 1.205
var whatsnew = 'Reject script no more called 2 fixed'; // ver 1.206
var whatsnew = 'When case state is \'Pending Deferred Action\', SWOW update sets ETA time under Planning tab. '; // ver 1.207
var whatsnew = 'SWOW ETA buttons now update line with cursor, no need to select ETA anymore.\nIf you put a line to COMPLETED, and want to revert, select COMPLETED and click ETA button.'; // ver 1.208
var whatsnew = 'Vendor checkpoint fields in case managenet & SWOW Empty Incident Impact warning '; // ver 1.209
var whatsnew = 'Better checking of \'mandatory\' fields, and jumping to right place in the case for case closure '; // ver 1.210
var whatsnew = 'Speedfix voor Brechtje '; // ver 1.211
var whatsnew = 'The speedfix voor Brechtje (1.211) contained some code fore testing new features. '; // ver 1.212
var whatsnew = 'Again fix for Brechtje '; // ver 1.213
var whatsnew = 'Fixes for Philippe et Benoit '; // ver 1.214
var whatsnew = 'Added the possebility to add and customize mail templates for mails sent by ITSM plus.'; // ver 1.215
var whatsnew = 'Adds more variables to the mail templates and fix for empty action dropdowns.'; // ver 1.216
var whatsnew = 'Typos'; // ver 1.217
var whatsnew = 'More typos'; // ver 1.218
var whatsnew = 'No more typos(I hope) and an example for the mail templates with the various fields that can be used.'; // ver 1.219
var whatsnew = 'Case in seperate window stops script.'; // ver 1.220
var whatsnew = 'Separate buttons to reset Actions and Mail Templates.'; // ver 1.221
var whatsnew = 'Select and update mutiple workload entries at the same time not working, Now fixed.'; // ver 1.222
var whatsnew = 'Issue with cclist fixed.'; // ver 1.223
var whatsnew = 'Set parameters for third party cases, so we can send mail updates from ITSM.'; // ver 1.224
var whatsnew = 'Timer (2hrs) for cookies for third party case parameters. Also added click on frame to erase cookies'; // ver 1.225
var whatsnew = 'Added Scram Tab.\nPlease provide usefull links that can appear on the Scram page.'; // ver 1.226
var whatsnew = 'Because ITSM is so slow, I found the tasklist refresh sometimes kicks in before ITSM responds to me clicking a case.\nTo resolve this I stop the refresh timers when a case link is clicked.'; // ver 1.227
var whatsnew = 'ITSM no longer stops the refresh timers when a case link is opened in another tab/window.'; // ver 1.228
var whatsnew = 'Added re-assign to EU.BE.RSO.SD.Closure queue.'; // ver 1.229
var whatsnew = 'RMA tab goes green when RMA mail is sent and copy in work notes is saved.'; // ver 1.230
var whatsnew = 'Maarten Keyen found a bug.'; // ver 1.231
var whatsnew = 'Another closure queue bug fixed.'; // ver 1.232
var whatsnew = 'Mail templates {case} geeft casenummer'; // ver 1.233
var whatsnew = 'New case screen, added link to other cases for customer'; // ver 1.234
var whatsnew = 'Fix for Wim and Benoit (possible)'; // ver 1.235
var whatsnew = 'New case screen, added link to other cases for location'; // ver 1.236
var whatsnew = 'New case screen, added link to other cases for Requester'; // ver 1.237
var whatsnew = 'New case screen, fix'; // ver 1.238
var whatsnew = 'Revert bad caseclosing'; // ver 1.239
var whatsnew = 'Template vars update'; // ver 1.240
var whatsnew = 'Mail templates {siteid} gives siteid '; // ver 1.241
var whatsnew = 'Closing behaviour adjusted. '; // ver 1.245
var whatsnew = 'SWOW bug Nick fixed. '; // ver 1.246
var whatsnew = 'Better performance for IM links insertion. '; // ver 1.247
var whatsnew = 'Timing pageload and script execution'; // ver 1.248
var whatsnew = 'More specific queue checking'; // ver 1.249
var whatsnew = 'Remove attachments for RSO testing1 (sandbox unavailable)'; // ver 1.250
var whatsnew = 'Remove attachments for RSO testing2 (sandbox unavailable)'; // ver 1.251
var whatsnew = 'Attachments handling update'; // ver 1.252
var whatsnew = 'No popups for non-default view'; // ver 1.253
var whatsnew = 'Better handling of case details when re-assigning between engineers'; // ver 1.254
var whatsnew = 'Better handling and viewing of case attachments'; // ver 1.255
var whatsnew = 'SWOW update'; // ver 1.256
var whatsnew = 'Revert on compacting page width.'; // ver 1.257
var whatsnew = 'SWOW update 2'; // ver 1.258
var whatsnew = 'SWOW update 3'; // ver 1.259
var scriptversion = GM_info.script.version ;
var instance = ( location.hostname.indexOf('dimensiondatasandbox') > -1 ) ? 'sandbox' : (location.hostname.indexOf('dimensiondataservices') > -1 ) ? 'services' : (location.hostname.indexOf('dimensiondataorion') > -1 ) ? 'orion' : '';
var newversion = 'Welcome to version ' + scriptversion + ' of the: \'ITSM use default email client\' script.\n\n\
I believe this is the first time you run ths version of the script.\n\nNew in this version is: ' + whatsnew;
newversion += '\n\nEnjoy.\n\nMichel :-)\n\n';
kerstmis = '\n\n\
Prettige Feestdagen. \/\\ \n\
Bonnes fêtes. \/o.\\ \n\
Season greetings. \/.o .\\ \n\
Frohe Feiertage. \/o . o.\\ \n\
\/. o. o. o\\\n\
\/----n n----\\';
nieuwjaar = '\n\n\
Gelukkig Nieuwjaar.\n\
Bonne Année.\n\
Happy New Year.\n\
Frohes Neujahr.\n';
// GM_addStyle(' table.wide { max-width:1500px !important;width:1450px !important; }');
GM_addStyle(' a.linked { white-space:nowrap !important;}' ); // disable if you need a bigger screen
console.log('#=#=#=# started ');
var script = window.location.pathname; // Get page type, request, change, incident, etc
console.log('#=#=#=# started script:' + script);
// var bgcolor = '#ddd';
// var txtcolor = '#000';
var bgcolor = '';
var txtcolor = '';
if ( GM_getValue('ITSMbgcolor' ) ) { console.log('# ', GM_getValue('ITSMbgcolor' )); bgcolor = GM_getValue('ITSMbgcolor' ) }
if ( GM_getValue('ITSMtxtcolor') ) { console.log('# ', GM_getValue('ITSMtxtcolor')); txtcolor = GM_getValue('ITSMtxtcolor' ) }
if ( bgcolor !== '' && txtcolor !=='') {
setcolors( bgcolor,txtcolor );
console.log('# colors' ,bgcolor,txtcolor);
} else {
console.log('# nocolors');
}
// ==============================================================================================================================================================
// = ITSM build-in email =
// = =
if ( script === '/email_client.do' ) {
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready( function() {
if ( GM_getValue('curlist')) {
var list = GM_getValue('curlist');
var casenr = $('#subject').val().split(' ')[0];
console.log('# email_client', casenr );
if ( list.indexOf(casenr) > -1 ) {
var tolist = list.split('?subject=')[0].replace('mailto://','');
var cclist = list.split('&CC=')[1];
var frlist = cclist.split('&FROM=')[1];
var cclist = cclist.split('&FROM=')[0];
// alert(frlist + ' ' + tolist + ' ' + cclist );
$('#MsgFrom').val(frlist);
$('#MsgReplyTo').val(frlist);
$('#sys_display\\.to_block').val(tolist);
$('#sys_display\\.cc_block').val(cclist);
}
}
});
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = ITSM create page =
// = =
if ( script === '/u_new_call.do' ) {
// ==============================================================================================================================================================
GM_addStyle(' .mybut { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff !important;padding:3px 4px 3px 4px;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
GM_addStyle(' .mybut:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important;}');
GM_addStyle(' .mybut:after { position:absolute;top:2px;left:2px;width:calc(100%-4px);height:50%;background:linear-gradient(rgba(0,255,0,0.9),rgba(255,255,255,0.1));}');
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready( function() {
$('button.form_action_button').addClass('mybut');
$('input#sys_display\\.u_new_call\\.company').keyup( function() {
console.log('#=#_ u_new_call Company changed to ', $('input#u_new_call\\.company').val(), $('input#sys_display\\.u_new_call\\.company').val() );
puticons();
setTimeout(function() { puticons(); },1500);
});
$('input#sys_display\\.u_new_call\\.location').keyup( function() {
console.log('#=#_ u_new_call Location changed to ', $('input#u_new_call\\.location').val(), $('input#sys_display\\.u_new_call\\.location').val() );
puticons();
setTimeout(function() { puticons(); },1500);
});
$('input#sys_display\\.u_new_call\\.u_caller').keyup( function() {
console.log('#=#_ u_new_call Requester changed to ', $('input#u_new_call\\.u_caller').val(), $('input#sys_display\\.u_new_call\\.u_caller').val() );
puticons();
setTimeout(function() { puticons(); },1500);
});
$('input#sys_display\\.u_new_call\\.company' ).blur( function() { puticons(); } ).focus( function() { puticons(); } );
$('input#sys_display\\.u_new_call\\.location').blur( function() { puticons(); } ).focus( function() { puticons(); } );
$('input#sys_display\\.u_new_call\\.u_caller').blur( function() { puticons(); } ).focus( function() { puticons(); } );
if ( $('#showcompcase').length < 1) { $('#element\\.u_new_call\\.company > td:nth-child(2) > span:nth-child(2) > span:nth-child(4)').append('<a id="showcompcase" href="" target=_blank><img src="images/green_back.gifx" style="width:14px;height:14px;" /></a>');}
if ( $('#showcomploca').length < 1) { $('#element\\.u_new_call\\.location > td:nth-child(2) > span:nth-child(2) > span:nth-child(4)').append('<a id="showcomploca" href="" target=_blank><img src="images/green_back.gifx" style="width:14px;height:14px;" /></a>');}
if ( $('#showcompucal').length < 1) { $('#element\\.u_new_call\\.u_caller > td:nth-child(2) > span:nth-child(2) > span:nth-child(4)').append('<a id="showcompucal" href="" target=_blank><img src="images/green_back.gifx" style="width:14px;height:14px;" /></a>');}
$('#showcompcase').hide();
$('#showcomploca').hide();
$('#showcompucal').hide();
function puticons() {
if ( $('input#u_new_call\\.company').val() !== '' ) {
$('#showcompcase').attr('href', '/task_list.do?sysparm_query=company=' + $('input#u_new_call\\.company').val() + '&sysparm_view=' );
$('#showcompcase').attr('title', 'Cases for Customer: ' + $('input#sys_display\\.u_new_call\\.company').val() );
$('#showcompcase').show();
console.log('#=#_ update link for company:', $('input#u_new_call\\.company').val(), $('input#sys_display\\.u_new_call\\.company').val() );
} else { $('#showcompcase').hide(); }
if ( $('input#u_new_call\\.location').val() !== '' ) {
$('#showcomploca').attr('href', '/task_list.do?sysparm_query=location=' + $('input#u_new_call\\.location').val() + '&sysparm_view=' );
$('#showcomploca').attr('title', 'Cases for Customer: ' + $('input#sys_display\\.u_new_call\\.location').val() );
$('#showcomploca').show();
console.log('#=#_ update link for location:', $('input#u_new_call\\.location').val() );
} else { $('#showcomploca').hide(); }
if ( $('input#u_new_call\\.u_caller').val() !== '' ) {
$('#showcompucal').attr('href', '/task_list.do?sysparm_query=u_caller=' + $('input#u_new_call\\.u_caller').val() + '&sysparm_view=' );
$('#showcompucal').attr('title', 'Cases for Customer: ' + $('input#sys_display\\.u_new_call\\.u_caller').val() );
$('#showcompucal').show();
console.log('#=#_ update link for requester:', $('input#u_new_call\\.u_caller').val() );
} else { $('#showcompucal').hide(); }
}
});
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = Scram =
// = =
if ( window.location.hostname === 'scram.client.eu.didata.local' ) {
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready( function() {
if ( $('h1:contains("You are authenticated to the Dimension Data SCRAM solution.")').length > 0 ) {
var qsparam = new Array();
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i = 0; i < parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0)
{
var key = parms[i].substring(0, pos);
var val = parms[i].substring(pos + 1);
qsparam[key] = val;
if (key === 'cust') {
var CustNM = decodeURIComponent(val);
}
}
}
$('<p id=addhere><font color=blue>ITSM+</font> links for customer:[' + CustNM + '].</p>').insertAfter('h1:contains("You are authenticated to the Dimension Data SCRAM solution.")');
if (CustNM === 'ACV/CSC' ) { $('#addhere').append('<p><a href=rdp://10.128.11.81>Nimsoft Server</a></p><p><a href=http://10.128.11.81>Nimsoft UMP</a></p><p><a href=https://10.128.11.83/webacs/pages/common/login.jsp>ACV PI</a></p>'); }
$('#addhere').append(' <p> <p> <p>Download rdp.bat - <a href=http://www.jjclements.co.uk/wp-content/uploads/2010/02/rdp.zip>HERE</a> to add Remote Desktop support for rdp links.</p>')
$('#addhere').append('<p>Links for your customer not here? Tell <a href="mailto://[email protected]?subject=Scram customer links&body=ITSM Customer name=%0A%0A<protocol>,<link>,<name>%0A%0AExample:%0ARDP, 10.128.11.81, Nimsoft." >me</a> (ITSM) customer name and a list of links. </p>')
// alert('authenticated');
}
});
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = MOVEit =
// = =
if ( window.location.search.indexOf('secmsgcomposenew') > -1 ) {
// ==============================================================================================================================================================
console.log('#=#=#=# MOVEit');
var casedt = new Date( GM_getValue('casedt') );
var dt = new Date();
if ( (dt - casedt) < 36000000 ) {
console.log('#=#=#=# cookie OK', (dt - casedt) );
var casemoveit = GM_getValue('casemoveit').split(';');
console.log('#=#=#=# cookie OK', casemoveit );
var recep = casemoveit[0];
var subj = decodeURIComponent(casemoveit[1]);
var body = casemoveit[2];
console.log('#=#=#=# ? ---' , body);
var body = casemoveit[2].replace(/%0A%0D%0A%0D%0A%0D%0A%0D/g,'<br></br>').replace(/%0D%0A%0D%0A/g,'<br></br>').replace(/%0A%0D%0A%0D/g,'<br></br>').replace(/%20/g,' ');
// var body = decodeURIComponent(casemoveit[2]);
$('input#tofield').val(recep);
$('input#fieldsubject').val(subj);
console.log('#=#=#=# ? ---' );
console.log('#=#=#=# ? ', $('iframe#arg04').length );
console.log('#=#=#=# ? ', $('iframe#arg04').contents().find() );
console.log('#=#=#=# 1 ? ', $('iframe#arg04').contents().find('html#arg04 > body').length );
console.log('#=#=#=# 2 ? ', $('iframe#arg04').contents().find('html#arg04 > body:nth-child(2)').length );
$('iframe#arg04').contents().find('html#arg04 > body:nth-child(2)').html(body);
console.log('#=#=#=# ? ach' );
} else {
console.log('#=#=#=# cookie too old! ', (dt - casedt) );
}
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = Noc Forum =
// = =
if ( script === '/phpbb3_1/viewforum.php' ) {
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready( function() {
var script = window.location.pathname;
console.log('#=#=#=# started script:' + script);
if ( location.search.indexOf('f=177') > -1 ) {
$('div#page-body > h2:nth-child(1)').append('<span> Search: <input id="combo1" list="combolist" type="text" /></span><datalist id="combolist"></datalist>');
$('a.forumtitle').each( function() {
// console.log('# forum ', $(this).text() );
$('#combolist').append('<option value="' + $(this).attr('href') + '">' + $(this).text() + '</option>');
});
$('#combo1').on('input', function () {
var val = this.value;
console.log('#=#=#=# customer ? ' + this.value );
if ( $('#combolist option').filter( function(){
return this.value === val;
}).length ) {
console.log('#=#=#=# customer ? ' + this.value );
location.href = this.value;
// alert(this.value);
}
});
}
if ( location.search.indexOf('look4=') > -1 ) {
var cust = decodeURI( location.search.split('look4=')[1].split('&')[0] ).replace('/','-');
// if (cust === '' ) { cust = ''; }
if (cust) {
console.log('#=#=#=# look4 customer:' + cust);
var t = $('a.forumtitle:contains("' + cust + '")').length ;
console.log('#=#=#=# customer found? ', t );
if (t > 0 ) {
$('a.forumtitle:contains("' + cust + '")').each( function() {
console.log('#=#=#=# customer found? ' + $(this).text(), $(this).attr('href') );
location.href = $(this).attr('href');
});
} else {
$('#combo1').val(cust);
}
}
}
console.log('#=#=#=# script ended:' + script);
});
}
if (script.indexOf('/phpbb3_1/adm/') > -1) {
GM_addStyle(' tr:hover { background-color: #c8c8cF; }' );
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = Sharepoint Customers =
// = =
if ( script.indexOf('/communities/eu/be.belgium/Lists/') > -1 ) {
// ==============================================================================================================================================================
// https://wired.dimensiondata.com/communities/eu/be.belgium/Lists/Cust/AllItems.aspx?&FilterField1=Customer_x0020_Group0&Filter=1&View={598D5911-E1D1-4B5A-95B9-FEF74261AB1C}
// https://wired.dimensiondata.com/communities/eu/be.belgium/cdc/_layouts/viewlsts.aspx?BaseType=1&authToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkI0MEYwa0NkRENGVW93UENITmtta2MxV3d4YyJ9.eyJhdWQiOiJ1cm46QXBwUHJveHk6Y29tIiwiaXNzIjoiaHR0cDovL2F1dGguZGltZW5zaW9uZGF0YS5jb20vYWRmcy9zZXJ2aWNlcy90cnVzdCIsImlhdCI6MTQ3Nzk5MTUxNiwiZXhwIjoxNDc3OTk1MTE2LCJyZWx5aW5ncGFydHl0cnVzdGlkIjoiNTllNjZlY2UtY2UxOS1lNjExLTgwZmEtMDAxNTVkODQxNjBkIiwidXBuIjoibWljaGVsLmhlZ2VyYWF0QGRpbWVuc2lvbmRhdGEuY29tIiwiY2xpZW50cmVxaWQiOiIzZmM3MzgzYi0yNzcwLTAwMDEtYjY0ZC1lNjNmNzAyN2QyMDEiLCJhdXRoX3RpbWUiOiIyMDE2LTExLTAxVDA5OjExOjA5Ljg0MVoiLCJhdXRobWV0aG9kIjoidXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQiLCJ2ZXIiOiIxLjAifQ.eMGAVMgnfbV1LIIMyoHDCET9-pR7g88GkiYebV2CwIrO0_9k24BWdbIl7d5VP7CT9Bq9m4uzxy0UKgVa9yD2AN63LtwQMBQcolW0C00VlmNHA-CyhhVAfcDAFpPqlBrGzYBPox7HcRmOAl7bYHnTNiXlRmMJ70W25uou4AI1YRhi3qt2QwaJB_HOCc1zB9Pc2oeHuAmk5IsOmP9yqcIWa12t6ZQvJFxw6lriPnth7JS3MHWFwRnF7X0-nN75t5z7k4irwu9ZwrEG0AvhnugLAXiSmrNsPT5R84HqkNwnIE55r9FJF86GOs56PE6jFHlh_H-k3zKjJ-Hx8YJKE_pOiA&client-request-id=3fc7383b-2770-0001-b64d-e63f7027d201
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready( function() {
var script = window.location.pathname;
console.log('#=#=#=# started script:' + script);
if (location.search.indexOf('FilterValue1=')) {
var cust = decodeURI( location.search.split('FilterValue1=')[1].split('&')[0].toUpperCase() );
console.log('#=#=#=# look4 customer:' + cust);
if ( $('#diidFilterCustomer_x0020_Group0 option').filter( function() { return this.value === cust; } ).length ) {
location.href = script+ '?FilterField1=Customer_x0020_Group0&FilterValue1=' + cust ;
}
if ( $('#diidFilterLinkTitle option').filter( function() { return this.value === cust; } ).length ) {
location.href = script+ '?FilterField1=LinkTitle&FilterValue1=' + cust ;
}
}
$('#diidFilterCustomer_x0020_Group0').hide().parent().prepend('<input id="combo1" list="datalist1" type="text" /> <datalist id="datalist1"></datalist>');
var $options = $('#diidFilterCustomer_x0020_Group0').clone();
$('#datalist1').append( $options );
$('#diidFilterLinkTitle' ).hide().parent().prepend('<input id="combo2" list="datalist2" type="text" size=30 /> <datalist id="datalist2"></datalist>');
var $options = $('#diidFilterLinkTitle').clone();
$('#datalist2').append( $options );
$('#diidFilterUsual_x0020_Name' ).hide().parent().prepend('<input id="combo3" list="datalist3" type="text" size=40 /> <datalist id="datalist3"></datalist>');
var $options = $('#diidFilterUsual_x0020_Name').clone();
$('#datalist3').append( $options );
//diidFilterLinkTitle
if (cust) {
$('#combo1').val(cust);
$('#combo2').val(cust);
$('#combo3').val(cust);
}
$('#combo1').on('input', function () {
var val = this.value.toUpperCase();
if ( $('#datalist1 option').filter( function() { return this.value === val; } ).length ) {
console.log('#=#=#=# customer ' + val + ' found !! ');
location.href = script+ '?FilterField1=Customer_x0020_Group0&FilterValue1=' + val ;
// location.href = '/communities/eu/be.belgium/Lists/Cust/Summary.aspx?FilterField1=Customer_x0020_Group0&FilterValue1=' + val ;
}
});
$('#combo2').on('input', function () {
var val = this.value.toUpperCase();
if ( $('#datalist2 option').filter( function() { return this.value === val; } ).length ) {
console.log('#=#=#=# customer ' + val + ' found !! ');
location.href = script+ '?FilterField1=LinkTitle&FilterValue1=' + val ;
}
});
console.log('#=#=#=# script ended:' + script);
});
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = ITSM top page =
// = =
if ( script === '/' || script === '/navpage.do' || script === '/nav_to.do' || script === '/home.do' ) {
// ==============================================================================================================================================================
var loggedin = document.getElementById('gsft_full_name').innerHTML;
$('body').append('<div id="floattest" style="position:fixed;right:30px;bottom:20px;"><div>');
// buttons
// GM_addStyle(' .mybut { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff;padding:3px 4px 3px 4px;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
// GM_addStyle(' .mybut:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important;}');
// GM_addStyle(' .mybut:after { position:absolute;top:2px;left:2px;width:calc(100%-4px);height:50%;background:linear-gradient(rgba(0,255,0,0.9),rgba(255,255,255,0.1));}');
//
// GM_addStyle(' .flyout-button { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff !important;padding:3px 4px 3px 4px;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
// GM_addStyle(' .flyout-button:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0 !important;padding;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important;}');
// GM_addStyle(' .flyout-button:after { position:absolute;top:2px;left:2px;width:calc(100%-4px);height:50%;background:linear-gradient(rgba(0,255,0,0.9),rgba(255,255,255,0.1));}');
//
//
// GM_addStyle(' .avatar { line-height:15px !important; }' );
// GM_addStyle(' a.navbar-brand { height:15px !important; background-image:none !important; display:none !important; }' );
// GM_addStyle(' #user_info_dropdown { height:15px !important; }' );
// GM_addStyle(' img#mainBannerImage16 { display:none !important; height:5px; }' );
// GM_addStyle(' div.navbar-header { display:none !important; height:1px !important; }' );
// borders 4px
// GM_addStyle(' .ui-layout-resizer-west { width:4x !important; border-width:0px !important; background-image:none !important; }' );
// GM_addStyle(' .ui-layout-resizer-east { width:4x !important; border-width:0px !important; background-image:none !important; }' );
// GM_addStyle(' .ui-layout-resizer-north { height:4x !important; border-width:0px !important; background-image:none !important; }' );
// GM_addStyle(' .ui-layout-resizer-south { height:4x !important; border-width:0px !important; background-image:none !important; }' );
// GM_addStyle(' .ui-layout-resizer-south-open { height:4x !important; border-width:0px !important; background-image:none !important; }' );
// icons 16 px
// GM_addStyle(' #edge_west { width:16px !important; height:1600px; }');
// GM_addStyle(' #edge_west_inner { width:16px !important;padding:0px !important; min-width:16px !important; }');
// GM_addStyle(' .hr { min-width:16px !important; }'); // width:16px !important;padding:0px !important;
// GM_addStyle(' .edge { width:16px !important;padding:0px !important;border:0px none #000 !important;min-height:0px !important;font-size:16px !important; }');
// GM_addStyle(' .edge_item { width:16px !important;padding:0px !important;border:0px none #000 !important;min-width:0px !important; }');
// GM_addStyle(' div.edge_item:hover { background-image: linear-gradient(90deg, #8F8, #fff, #8F8); }');
// GM_addStyle(' .right { width:16px !important;padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important; }');
// GM_addStyle(' .left { width:16px !important;padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important; }');
// GM_addStyle(' .item1 { width:16px !important;padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important; }');
// GM_addStyle(' .item2 { width:16px !important;padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important; }');
// GM_addStyle(' .ui11 { padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important;white-space:nowrap; }');
// GM_addStyle(' .inner { padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important; }');
// GM_addStyle(' .outer { padding:0px !important;border:0px none #000 !important;border-radius:2px !important;right:0px !important;margin:0px !important; }');
// GM_addStyle(' .icon { padding:0px !important;border:0px none #000 !important;line-height:10px !important;font-size:16px !important; }');
// GM_addStyle(' .icon_list { padding:0px !important;border:0px none #000 !important;line-height:10px !important;font-size:16px !important; }');
// GM_addStyle(' .black { padding:4px !important; }');
// GM_addStyle(' .bookmark-title { display:none !important;} ');
// GM_addStyle(' #edge_south_debug { display:block !important;} ');
// GM_addStyle(' #edge_all_bookmarks { display:none !important;} ');
// GM_setValue('loggedin', $('#gsft_full_name').text() );
//
// GM_addStyle(' .ui-layout-toggler-west:hover { background-image: linear-gradient(#8F8, #fff, #8F8); } ');
// GM_addStyle(' .ui-layout-resizer-west-open:hover{ background-image: linear-gradient(#8F8, #fff, #8F8) !important; } ');
// GM_addStyle(' .ui-layout-toggler-north:hover { background-image: linear-gradient(90deg, #8F8, #fff, #8F8); } ');
//
// GM_addStyle(' .navpage-nav { width:16px !important; padding:0px !important; }' );
// GM_addStyle(' .navpage-nav-collapsed { width:16px !important; padding:0px !important; }' );
// GM_addStyle(' .nav-body { width:16px !important; padding:0px !important; }' );
// GM_addStyle(' ul.nav- { height:25px !important; padding:0px !important; width:0px !important; }' );
// GM_addStyle(' li.ng-scope { height:25px !important; padding:0px !important; width:0px !important; }' );
// GM_addStyle(' body { -moz-box-sizing:unset; -webkit-box-sizing:unset; box-sizing:unset; }' );
// GM_addStyle(' body::before { -moz-box-sizing:unset; -webkit-box-sizing:unset; box-sizing:unset; }' );
// ng-scope ui-sortable-handle
// .navpage-nav-collapsed .navpage-nav width:20px
// .navpage-nav-collapsed .nav-body padding:0px;
// GM_addStyle(' .edge_flyout_footer_content { background-color:#ffffff; }');
// GM_addStyle(' .section_header_body_no_scroll { font-size:10px !important; line-height:10px !important; padding:0px !important; }');
// GM_addStyle(' body { font-size:10px !important; line-height:10px !important; padding:0px !important; }');
// GM_addStyle(' div { font-size:10px !important; line-height:10px !important; padding:0px !important; }');
if (instance === 'sandbox') {
$('tr.nav_header_stripe').css('background-color','#ffdc73');
$('div#edge_center' ).css('background-color','#ffdc73');
}
if (instance === 'orion') {
$('tr.nav_header_stripe').css('background-color','#ff7373');
$('div#edge_center' ).css('background-color','#ff7373');
}
if (newversion !== ''){
if (GM_getValue('ITSMscriptversion')){
if (GM_getValue('ITSMscriptversion') !== scriptversion ){
alert(newversion);
GM_setValue('ITSMscriptversion',scriptversion);
}
} else {
alert(newversion);
GM_setValue('ITSMscriptversion',scriptversion);
}
}
// setTimeout(function() {
// var x = 0;
// $('div#edge_pinned_bookmarks > div.edge_item').each( function() {
//// $('div.edge_item').each( function() {
// var itemurl = ( $(this).is('[data-href]') ) ? $(this).attr('data-href') : 'no data-href';
// x++;
//// console.log('##=## Change data-href ' + x + ' ' + itemurl , $(this).attr('data-href') );
// if ( itemurl.indexOf('getMyAssignments') > -1 ) {
// itemurl = itemurl.replace('^EQ&sysparm_cancelable=','^u_majorISEMPTY^EQ&sysparm_cancelable=');
// $(this).attr('data-href',itemurl);
// console.log('##=## Change data-href ' + x + ' ' + itemurl , $(this).attr('data-href') );
// }
// });
// }, 6000);
$('img#mainBannerImage16').attr('style','').hide;
$('a.navbar-brand').attr('style','').hide;
setTimeout(function() {
$('img#mainBannerImage16').attr('style','display:none !important;').hide;
$('a.navbar-brand').attr('style','display:none !important;').hide;
}, 2000);
if (loggedin === 'Michel Hegeraat') {
$('#floattest').append('<p class="mybut"> ITSM+ TESTING123 </p><p class="mybut">123</p><p class="mybut">TESTING<br>test ing<br>TES TING</p>');
}
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = ITSM =
// = =
if ( script === '///' ) {
// ==============================================================================================================================================================
// GM_addStyle(' button { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff !important;padding:3px 4px 3px 4px;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
// GM_addStyle(' button:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0 !important;padding;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important;}');
// GM_addStyle(' button:after { position:absolute;top:2px;left:2px;width:calc(100%-4px);height:50%;background:linear-gradient(rgba(0,255,0,0.9),rgba(255,255,255,0.1));}');
GM_addStyle(' .navpage-nav { width:16px !important; padding:0px !important; }' );
GM_addStyle(' .navpage-nav-collapsed { width:16px !important; padding:0px !important; }' );
GM_addStyle(' .nav-body { width:16px !important; padding:0px !important; }' );
GM_addStyle(' .ng-scope { width:16px !important; padding:0px !important; }' );
GM_addStyle(' ul.nav- { height:25px !important; padding:0px !important; width:0px !important; }' );
GM_addStyle(' body { -moz-box-sizing:unset; -webkit-box-sizing:unset; box-sizing:unset; }' );
setTimeout(function() {
$('iframe#gsft_main').attr('src','task_list.do?sysparm_query=active=true^assigned_to=javascript:getMyAssignments%28%29^u_majorISEMPTY^EQ&sysparm_cancelable=true');
$('div.edge_item').mouseover( function() {
console.log('# mouseover 1 links ' + $('a.mini_form_link').length );
setTimeout(function() {
$('.mini_form_link').click( function() {
setTimeout(function() {
console.log('# 1 links ' + $('a.mini_form_link').length );
console.log('# 2 buttons ' + $('flyout-button').length );
$('button.flyout-button').addClass('mybut');
}, 700);
console.log('# 1 links ' + $('a.mini_form_link').length );
console.log('# 2 buttons ' + $('flyout-button').length );
$('button.flyout-button').addClass('mybut');
}, 1000);
});
$('button.flyout-button').addClass('mybut');
});
// $('button.edge').mouseover( function() {
// console.log('# mouseover 1 links ' + $('a.mini_form_link').length );
// setTimeout(function() {
// $('a.mini_form_link').on('click', function() {
// setTimeout(function() {
// console.log('# 1 links ' + $('a.mini_form_link').length );
// console.log('# 2 buttons ' + $('flyout-button').length );
// $('button.flyout-button').addClass('mybut');
// }, 700);
// }, 700);
// });
// });
}, 2000);
setTimeout(function() {
$('#request_manager_output').css('display','inline').css('color','#000');
$('#request_message').css('color','#000');
$('#request_timer').css('color','#000');
}, 5000);
var $tobj5 = $('#banner_top_right').clone(true).prop('id','searchf');
$('#nav_header_stripe_decorations').before( '<td id=td2></td>' );
$('#nav_header_stripe_decorations').attr('valign','top');
$('#nav_header_stripe_decorations').removeClass('column_head');
$('#loggedin').removeClass('column_head');
$('#nav_header_stripe_decorations').css('font-size','18px').parent().append('<td id=td3> </td>');
$('#td2').append( $tobj5 );
$('#searchf > span:nth-child(3) > a:nth-child(2)').remove();
// home_splash.do?sysparm_direct=true&sysparm_userpref_homepage=f3d579f02b4eb4484068c1cfe8da153e
$('.nav_header_stripe').css('background-color','#EEE');
if (instance === 'sandbox') {
$('tr.nav_header_stripe').css('background-color','#ffdc73');
$('div#edge_center' ).css('background-color','#ffdc73');
}
if (instance === 'orion') {
$('tr.nav_header_stripe').css('background-color','#ff7373');
$('div#edge_center' ).css('background-color','#ff7373');
}
var swtch = '<select id="changesys" ><option class=blk value="dimensiondataservices"> Services</option><option class="blk snd" value="dimensiondatasandbox"> Sandbox</option><option class="blk ori" value="dimensiondataorion"> Orion</option></select>'
$('#banner_row').remove();
$('#navpage_header_control_button').wrap('<span id=homeb style="display:inline;"></span>')
$('#homeb').before('<span> </span>'); //.css('border-style','none')
$('.nav_header_button').addClass('mybut').css('font-weight','100');
$('#homeb').addClass('mybut').css('padding','0px 0px 2px 0px').css('font-size','16px');
$('#navpage_header_control_button').removeClass('mybut').removeClass('nav_header_button').css('background-color','transparent').css('padding','1px 0px 6px 0px').css('margin','0px 0px 0px 0px').css('line-height','6px').css('font-weight','100');
$('#sysparm_search').css('color','#000').css('width','100px');
$('#gsft_login').css('color','#000');
// if ($('#gsft_login').text().indexOf('Hegeraat') > -1) {
$('#gsft_login').append(' on ' + instance + ' ' + swtch);
// } else { $('#gsft_login').append(' on ' + instance); }
$('#changesys').val('dimensiondata' + instance).css('border','0px').css('outline','none'); //.css('background-image','url(images/drop_down.gifx)')
$('#changesys').on('change', function() { window.location.href = 'https://' + $('#changesys').val() + '.service-now.com'; } )
GM_addStyle(' select#changesys { background-repeat:no-repeat;background-position:0px;background-color:transparent;outline:none;background-image:url(images/drop_down.gifx);color:transparent !important;width:10px;padding:0px 1px 0px 1px;margin-right:4px;line-height:0.8;font-size:12px;border:0px; } ');
GM_addStyle(' .nav_header_button { background-color: transparent !important; border-color:#FFF !important; }' ); // color:#000 !important;
GM_addStyle(' .nav_header_button:hover { color:#000 !important; }' );
GM_addStyle(' #navpage_header_control_button:hover { color:#000 !important; }' );
GM_addStyle(' .blk { color:#000 !important; }' );
GM_addStyle(' .snd { background-color:#ffdc73 !important; }' );
GM_addStyle(' .ori { background-color:#ff7373 !important; }' );
GM_addStyle(' .navpage-nav { width:32px !important; }' );
$('.nav_header_stripe').find('td').css('padding','0px').css('border-style','none');
$('.nav_header_banner').css('padding','0px');
$('#request_manager_output').css('display','inline').css('color','#000');
$('#request_message').css('color','#000');
$('#request_timer').css('color','#000');
$('#nav_header_stripe_decorations').append(' <a class=mybut style="padding:0px 0px 0px 2px;" href="/home_splash.do?sysparm_direct=true" target="gsft_main"><img valign=top hwidth=12 height=12 class="" src=/images/icons/home_16.gifx /></a>');
console.log('# /script end');
// $('.nav_header_button:nth-child(2)').parent().addClass('mybut');
// $('.nav_header_button').removeClass('nav_header_button');
// $('.mybut').css('padding','0px');
// $('.nav_header_button').css('background-color','#CCC').css('color','#000');
// $('#navpage_header_control_button').css('font-variant-position','super').css('-moz-font-feature-settings','sups').css('-webkit-font-feature-settings','sups').css('font-feature-settings','sups').css('height','21px').css('font-weight','400');
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = ITSM icon_browse =
// = =
if ( script === '/icon_browse.do' ) {
// ==============================================================================================================================================================
GM_addStyle(' button { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff !important;padding:3px 4px 3px 4px;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
GM_addStyle(' button:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0 !important;padding;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important;}');
GM_addStyle(' button:after { position:absolute;top:2px;left:2px;width:calc(100%-4px);height:50%;background:linear-gradient(rgba(0,255,0,0.9),rgba(255,255,255,0.1));}');
}
if ( script === '/sys_user_list.do' ) {
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = ITSM Task List =
// = =
if ( script === '/task_list.do' ) {
// ==============================================================================================================================================================
var p = GM_listValues();
console.log('##=## GM_listValues ' + p.length );
GM_addStyle(' tr.list_even td { background-color: #F0F0FF ; color:#000; }' );
GM_addStyle(' tr.list_odd td { background-color: #F8F8FF ; color:#000; }' );
GM_addStyle(' tr.list_even a { color:#003; }' );
GM_addStyle(' tr.list_odd a { color:#006; }' );
GM_addStyle(' .my_list_sla_0 { background:rgba(244,255,244,1);color:#000 !important;border-top-left-radius:4px;border-bottom-left-radius:4px; }' ); // background-color: #F4FFF4 background:rbga(244,255,244,0.9)
GM_addStyle(' .my_list_sla_1 { background:rgba(224,255,224,1);color:#000 !important; }' ); // background-color: #E0FFE0 background:rbga(224,255,224,0.9)
GM_addStyle(' .my_list_sla_2 { background:rgba(186,255,186,1);color:#000; font-weight: bold !important; text-decoration:none !important; }' ); // background-color: #BAFFBA background:rbga(186,255,186,0.9)
GM_addStyle(' .my_list_sla_3 { background:rgba(144,238,144,1);color:#000; font-weight: bold !important; text-decoration:none !important; }' ); // background-color: #90EE90 background:rbga(144,238,144,0.9)
GM_addStyle(' .my_list_sla_4 { background:rgba(240,230,140,1);color:#000; font-weight: bold !important; text-decoration:none !important; }' ); // background-color: #F0E68C background:rbga(240,230,140,0.9)
GM_addStyle(' .my_list_sla_5 { background:rgba(255,255, 0,1);color:#000; font-weight: bold !important; text-decoration:none !important; }' ); // background-color: #FFFF00 background:rbga(255,255, 0,0.9)
GM_addStyle(' .my_list_sla_6 { background:rgba(255,208, 4,1);color:#000; font-weight: bold !important; text-decoration:none !important; }' ); // background-color: #FFD004 background:rbga(255,208, 4,0.9)
GM_addStyle(' .my_list_sla_7 { background:rgba(255,165, 0,1);color:#000; font-weight: bold !important; text-decoration:none !important; }' ); // background-color: #FFA500 background:rbga(255,165, 0,0.9)
GM_addStyle(' .my_list_sla_8 { background:rgba(255, 5, 2,1);color:#fff !important; font-weight: bold !important; text-decoration:none !important; border-top-right-radius:4px; border-bottom-right-radius:4px; }' ); // background-color: #FF0502 background:rbga(255, 5, 2,0.9)
GM_addStyle(' td.P1cell { background-color: tomato !important; }' );
GM_addStyle(' td.P2cell { background-color: orange !important; }' );
GM_addStyle(' .list2_cell_background { border:1px solid #000; }' );
GM_addStyle(' td.list_decoration_cell { background-color: transparent !important; }' );
GM_addStyle(' a.linked { white-space:nowrap !important;}' ); // disable if you need a bigger screen
GM_addStyle('.vt { padding:4px !important; }'); // !important
GM_addStyle('.redlink { color:red !important;fontWeight:bold !important;' );
GM_addStyle(' body { font-size:12px !important; line-height:13px !important; padding:0px !important; }');
GM_addStyle(' .vt { padding:0px 4px 0px 4px !important; }');
GM_addStyle(' .navbar { padding:0px 4px 0px 4px !important; }');
GM_addStyle(' .btn-icon { font-size:10px !important; line-height:10px !important; padding:0px !important; height:13px !important; }');
GM_addStyle(' .form-control { height:20px !important; }');
GM_addStyle(' .input-group-checkbox { font-size:10px !important; line-height:10px !important; padding:0px !important; height:10px !important; min-height:10px !important; font-weight:100 !important; }');
GM_addStyle(' td, input, select { padding-top:0px !important; padding-bottom:0px !important;line-height:13px !important; }');
GM_addStyle(' table.drag_section_header { border: 1px solid #FFF !important;border-radius:3px !important; box-shadow: 5px 5px 15px 0px rgba(0,0,0,1.0) !important; padding:5px !important;}');
GM_addStyle(' td.drag_section_movearea input { padding-top:5px !important; padding-bottom:5px !important; color:#000;}');
GM_addStyle(' td.drag_section_movearea input[type=image] { padding-top:0px !important; padding-bottom:0px !important;}');
GM_addStyle(' .list_popup { font-size:10px !important; line-height:10px !important; padding:0px !important; }');
GM_addStyle(' .checkbox { font-size:10px !important; line-height:10px !important; padding:0px !important; height:10px !important; min-height:10px !important; font-weight:100 !important; }');
GM_addStyle(' .checkbox-label { font-weight:100 !important; }');
GM_addStyle(' button { border-color: #FFF !important; color:#000 !important;}' );
GM_addStyle(' div.vcr_controls { border-color: #FFF !important; }' );
var autoreload = GM_getValue('autoreload') || 'on';
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
if (typeof unsafeWindow == "undefined") {
unsafeWindow = window;
}
var observer = new MutationObserver( function(mutations) {
// console.log('##MutObSrvr forEach started');
mutations.forEach(function(mutation) {
var str = '##MutObSrvr ' + mutation.type + ' attr ' + mutation.attributeName + ' trgt ' + mutation.target ;
if ( str.indexOf('HTMLTableCell') < 0 && str.indexOf('HTMLTableRow') < 0 ) {
// console.log(str);
}
if ( str.indexOf('HTMLTableElement') > 0 && str.indexOf('attr style') > 0 ) {
colorlist('#fff');
// console.log(str);
setTimeout(function(){ colorlist('#fff'); }, 10);
}
});
});
var obstarget = document.querySelector('#task');
var obsconfig = { attributes: true, childList: true, characterData: true, subtree: true };
var itsmversion = $('#mainBannerImage',unsafeWindow.parent.document).attr('title');
var loggedin = $('#gsft_full_name',unsafeWindow.parent.document).text();
var row = findcol('task_table','task.assigned_to');
console.log('##=#=# row = ' + row );
var caselist = [];
var percentage = [];
var solaname = [];
var timeleft = [];
var SOtype = [];
var iFrameDoc;
$('#task_filter_toggle_image').parent().parent().attr('id','task_filter').css('display','none');
$('<td height=6 width=6><a id=tf_clickme><img title="Toggle task filter" src="images/toggle_right.gifx" height=12 width=12></img></a></td>').insertBefore( $('#task_filter_toggle_image').parent().parent() );
$('#tf_clickme').on('click', function() {
$('#task_filter').toggle();
$('#tf_clickme').find('img').attr('src', ($('#tf_clickme').find('img').attr('src') === 'images/toggle_right.gifx' ) ? 'images/toggle_left.gifx' : 'images/toggle_right.gifx' );
});
// ^assigned_to%3D
// ^u_current_stage%3Din_progress^EQ
// var url = '/task_sla_list.do?sysparm_query=u_assignee_groupLIKE.BE.^ORu_assignee_groupLIKE.TRG.^u_current_stage%3Din_progress^u_assigneeISNOTEMPTY^EQ';
// task_list.do?sysparm_query=active%3Dtrue%5Eassigned_to%3Dfb7a3ab06fbf15c062765ebd5d3ee4ef&sysparm_view=
// task_list.do?sysparm_userpref_module=1523b8d4c611227b00be8216ec331b9a&sysparm_query=active=true^assigned_to=javascript:getMyAssignments%28%29^EQ&sysparm_cancelable=true&sysparm_cancelable=true
// task_list.do?sysparm_cancelable=true&sysparm_query=active%3Dtrue^assigned_to%3Djavascript%3AgetMyAssignments%28%29^EQ
// task_list.do?sysparm_userpref_module=76de01ddccb24100a1ad816e89647287&sysparm_query=active=true^assigned_toISEMPTY^assignment_group=javascript:getMyGroups%28%29^u_task_in_outage_period=false^EQ^&sysparm_view=
// sysparm_query=active=true^u_assignee_group=javascript:getMyGroups()^EQ^u_current_stage%3Din_progress^EQ&sysparm_clear_stack=true
var url = '/task_sla_list.do?sysparm_query=u_assignee_groupLIKEEU.BE.^ORu_assignee_groupLIKEEU.TRG.^u_current_stage%3Din_progress^EQ&sysparm_clear_stack=true&sysparm_clear_stack=true';
var url = '/task_sla_list.do?sysparm_query=u_assignee_groupLIKEEU.BE.^ORu_assignee_groupLIKEEU.TRG.&sysparm_clear_stack=true&sysparm_clear_stack=true';
var url = '/task_sla_list.do?sysparm_query=u_assignee_groupLIKEEU.BE.^ORu_assignee_groupLIKEEU.TRG.^u_current_stageNOT INmanually_cancelled%2Cachieved%2Cbreached%2Ccancelled&sysparm_first_row=1&sysparm_view=';
var url2 = window.location.href;
var slalist = '';
if ( url2.indexOf('assigned_to%3Djavascript%3AgetMyAssignment') > -1 || url2.indexOf('assigned_to=javascript:getMyAssignment') > -1 ) {
// /task_sla_list.do?sysparm_query=^u_assignee=javascript:getMyAssignments()^EQ&sysparm_clear_stack=true&sysparm_clear_stack=true
url = '/task_sla_list.do?sysparm_query=^u_assignee=javascript:getMyAssignments()^u_current_stage=in_progress^EQ&sysparm_clear_stack=true&sysparm_clear_stack=true'
url = '/task_sla_list.do?sysparm_query=^u_assignee=javascript:getMyAssignments()&sysparm_clear_stack=true&sysparm_clear_stack=true'
console.log('# for user ');
slalist = 'user';
} else {
url = '/task_sla_list.do?sysparm_query=u_assignee_groupLIKEEU.BE.^ORu_assignee_groupLIKEEU.TRG.^u_current_stage%3Din_progress^EQ&sysparm_view=';
url = '/task_sla_list.do?sysparm_query=javascript:getMyGroups()^EQ&sysparm_view=';
url = "/task_sla_list.do?sysparm_query=active%3Dtrue^u_assignee_group%3Djavascript%3AgetMyGroups()^business_time_left>javascript%3Ags.getDurationDate('0 0%3A0%3A1')&sysparm_first_row=1&sysparm_view=";
console.log('# first 50 ');
slalist = 'be50';
}
// url = url2.replace('task_list','task_sla_list').replace('&sysparm_','^u_current_stage%3Din_progress^EQ&sysparm_').replace('assigned_to','u_assignee').replace('active%3Dtrue%5E','');
// url = '/task_sla_list.do?sysparm_query=u_assignee_groupLIKEEU.BE.^ORu_assignee_groupLIKEEU.TRG.^u_current_stage%3Din_progress^EQ&sysparm_view=';
console.log('##=# get slas for ' + url + '\nu2= ' + url2 + '\nref= ' + document.referrer );
$("body").append('<div id="sla_lijst"></div><p><div id="jq_get"></div>');
//
// = = = = = = Hide or Show SLA list = = = = = = //
//
$("#sla_lijst").css('display','block');
//
// = = = = = = Hide or Show SLA list = = = = = = //
//
// make timerbar
var tmrbar = '<span id="timeframe"></span> <progress title="Reload in 2:00" class="bar" max="100" value="0"></progress> <span id="framerow0" style="color:#444444;"></span><span id="framerow1"> <img class="toggleframe" title="Show/Hide commitments." src="images/arrows_expand_sm.gifx?v=2"></img> <img class="rfrsh" onclick="location.reload();" title="Reload task list." src="images/icons/refresh.gifx"></img> </span>';
// #=#=#= insert timer bars
if ($('.navbar-left').length == 0 ) {
$('#list_nav_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)').prepend(tmrbar);
if ( $('table.list_nav_bottom').length > 0 ) {
$('table.list_nav_bottom > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)').prepend(tmrbar);
} else {
$('#sla_lijst').append(tmrbar);
}
} else {
$('.navbar-left').prepend(tmrbar);
if ( $('table.list_nav_bottom').length > 0 ) {
$('table.list_nav_bottom > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)').prepend(tmrbar);
} else {
$('#sla_lijst').append(tmrbar);
}
}
// #=#=#= insert sla legend span
$('<span id="framerows"></span>').insertBefore('#framerow0');
$('.toggleframe').click(showhideframe).css('cursor','pointer');
$('.rfrsh').css('cursor','pointer');
$('.bar').css('width','100px').css('height','11px').css('cursor','pointer').css('border-radius','5px'); //.css('','')
// Turns off styling - not usually needed, but good to know.
// gets rid of default border in Firefox and Opera.
// Needs to be in here for Safari polyfill so background images work as expected. */ background-size: auto;
GM_addStyle('progress,progress[role] { appearance:none; -moz-appearance:none; -webkit-appearance:none; border:none; } '); // All HTML5 progress enabled browsers /* polyfill */
GM_addStyle('progress[role]:after { background-image: none; } ');
GM_addStyle('progress[role] strong { display: none; } ');
GM_addStyle('progress[role][aria-valuenow] { display: none; } ');
// set progress bar background color
GM_addStyle('progress,progress[role][aria-valuenow] { border-radius:5px;background: #FFAA00 !important; } '); // Firefox, Polyfill !important is needed by the polyfill
GM_addStyle('progress::-webkit-progress-bar { border-radius:5px;background: #FFAA00; } '); // Chrome
// set progress bar value color
GM_addStyle('progress::-moz-progress-bar { border-radius:5px;background: #666; } '); // Firefox
GM_addStyle('progress::-webkit-progress-value { border-radius:5px;background: #666; } '); // Chrome
var progressbar = $('.bar'),
max = progressbar.attr('max'),
time = (1000/max)*120,
value = progressbar.val();
$("#jq_get").css('display','none');
// $("#jq_get").css('display','block');
console.log('#=== reached 2.0 ', url2.indexOf('assigned_to'), url2.indexOf('getMyGroups'), url2.indexOf('assignment'), url2.indexOf('active') );
if ( url2.indexOf('assigned_to') == -1 && url2.indexOf('getMyGroups') == -1 && url2.indexOf('assignment') == -1 || url2.indexOf('active') == -1 ) {
console.log('#=== reached 2.1 No need for SLA');
} else {
console.log('#=== reached 3');
$('#framerow0').html(' Loading SLA/OLA\'s..... ').css('color', '#ff9').css('background-color', '#f88');
console.log('#=== reached 3.1');
getslalist();
console.log('#=== reached 3.2' , slalist);
}
console.log('##=# autoreload is: ', autoreload);
if ( autoreload === 'on') {
var reloadtimer = 120000; // reload every two minutes
var hopla2;
console.log('##=# set update timer');
var hopla = setInterval(function(){
console.log('##=# update slalist' );
location.reload();
}, reloadtimer);
}
$('img.list_nav').click( function () {
console.log('##=# cnav click ');
$('img.list_nav').css('background-color', '#f88');
});
$('a.linked').click( function(event) {
console.log('##=# Link ---- clicked ');
if ( event.ctrlKey || event.shiftKey || event.metaKey || ( event.button && event.button == 1 ) ) { // middle click, >IE9 + everyone else.
console.log('##=# Link clicked timers not stopped! ');
return;
event.preventDefault();
} else {
console.log('##=# Link ++++ clicked timers stopping! ');
clearInterval(hopla);
clearInterval(hopla2);
console.log('##=# Link ++++ clicked all timers stopped! ');
// return false;
}
});
$('input[id$="_first_row"]').change(function () {
console.log('##=# changed inputs ');
colorlist('#fff');
});
$('span[id$="_last_row"]').change(function () {
console.log('##=# changed span ');
colorlist('#fff');
});
$('table#task_table').change(function () {
console.log('##=# changed table ');
colorlist();
setTimeout(function(){ colorlist(); }, 1000);
});
$(unsafeWindow.document).on('onTableLoad', function () {
console.log('##=# onTableLoad event ');
colorlist('#fff');
});
console.log('#=== reached 1');
var timericonheigt = 24;
var iconpad = 8;
$('progress.bar').click( function() {
console.log('##=# progress bar clicked ');
auto_reload();
});
console.log('#=== starting autoreload ', autoreload );
if ( autoreload === 'on') {
var loading = function() {
value += 1;
addValue = progressbar.val(value); // $('.progress-value').html(value + '%'); <span class="progress-value">0%</span>
if (value == max) { clearInterval(animate); }
};
if ( autoreload === 'on') {
var animate = setInterval(function() { loading(); }, time );
}
var time2reload = reloadtimer/60000;
hopla2 = setInterval(function(){
timericonheigt--;
var h = (reloadtimer - (reloadtimer - (timericonheigt * (reloadtimer/24))))/1000 ;
time2reload = Math.floor(h/60)+ ':' + checkTime(h % 60);
$('.bar').attr('title','Reload in ' + time2reload + ' ');
// console.log('# === ', time2reload );
}, ( (reloadtimer -2000 )/24) );
} else {
$('.bar').val(100).attr('title','Click to restart auto reload timer');
GM_addStyle('progress,progress[role][aria-valuenow] { border-radius:5px;background: #4CD2FF !important; } '); // Firefox, Polyfill !important is needed by the polyfill
GM_addStyle('progress::-webkit-progress-value { border-radius:5px;background: #4CD2FF !important; } '); // Chrome
GM_addStyle('progress::-moz-progress-bar { border-radius:5px;background: #4CD2FF; } '); // Firefox
GM_addStyle('progress::-webkit-progress-value { border-radius:5px;background: #4CD2FF; } '); // Chrome
}
console.log('#=== end reached ');
function auto_reload() {
if ( autoreload === 'on') {
clearInterval(animate);
clearInterval(hopla);
clearInterval(hopla2);
autoreload = 'off';
console.log('##=# reload timer stopped ');
$('progress.bar').val(100).attr('title','Click to restart auto reload timer');
$('#timeframe').html('Auto page reload is: <font color="red"><b>OFF</b></font>');
GM_addStyle('progress, progress[role][aria-valuenow] { border-radius:5px;background: #4CD2FF !important; } '); // Firefox, Polyfill !important is needed by the polyfill
GM_addStyle('progress::-webkit-progress-value { border-radius:5px;background: #4CD2FF; } '); // Chrome
GM_addStyle('progress::-moz-progress-bar { border-radius:5px;background: #4CD2FF; } '); // Firefox
GM_addStyle('progress::-webkit-progress-value { border-radius:5px;background: #4CD2FF; } '); // Chrome
} else {
console.log('##=# reload timer started ');
$('#timeframe').html('Auto page reload is: <font color="green"><b>ON</b></font>');
autoreload = 'on';
GM_setValue('autoreload',autoreload);
location.reload();
console.log('##=# reload timer started ');
}
GM_setValue('autoreload',autoreload);
}
function getslalist() {
console.log('##=# get slalist');
$.get( url, function( data ) {
var TableHeaders = [];
$('#hdr_task_sla', $(data)).each(function() {
var arrayOfThisRow = [];
var tableData = $(this).find('th');
if (tableData.length > 0) {
tableData.each(function() { arrayOfThisRow.push($(this).attr('glide_label')); });
TableHeaders = arrayOfThisRow;
}
});
var TableDatarows = [];
var ctr = 0;
$('#task_sla_table tr', $(data)).each(function() {
var arrayOfThisRow = [];
var tableData = $(this).find('td');
if (tableData.length > 0) {
tableData.each(function() { arrayOfThisRow.push($(this).text()); });
TableDatarows.push(arrayOfThisRow);
ctr++;
console.log( "#=#= tbl ", arrayOfThisRow.join(', ') );
}
});
console.log( "#=#= ctr ", ctr );
var alertmsg = '';
var v2 = $('#task_sla_table > tbody:nth-child(2) > tr:nth-child(1)', $(data) ).length;
var f1 = findcol3('Task'); // Task =3
var f2 = findcol3('Business percentage'); // Business percentage = 4
if ( f2 == -1) {
alertmsg = 'Add Business percentage column to commitment list.';
// alert('Add Business percentage column to commitment list.')
f2 = findcol3('Percentage');
} // Percentage = 4 fallback if Business percentage is not there
var f3 = findcol3('Business time left'); // Timeleft = 5
if ( f3 == -1) {
// alert('Add Business time left column to commitment list.')
if (alertmsg.length > 1) { alertmsg += '\n'; }
alertmsg += 'Add Business time left column to commitment list.';
f2 = findcol3('Time left');
} // Percentage = 5 fallback if Business time left is not there
var f4 = findcol3('Type'); // Type = 15
var f5 = findcol3('Name'); // Name = 9
if (alertmsg.length > 1 && f1 > 1 && ctr > 0) { alert(alertmsg + '\n\nGoto menu: Service desk -> Commitments -> Assigned to me, Click on the gear-icon and add the required columns.\n\nNot clear? Come and see me. :-) \n\nMichel.'); }
console.log( "#=#= v2, f1, f2, f3 , f4 ", v2, f1, f2, f3 , f4 );
console.log( "#=#= data ", TableDatarows[1][f1], TableDatarows[1][f2], TableDatarows[1][f3] );
var tbl = $('#task_sla_table', $(data));
$("#jq_get").append(tbl);
if ( TableDatarows[1][f1].length > 0 ) {
var p = 0;
while ( p < ctr ) {
var casenr = TableDatarows[p][f1];
var perc = Number(TableDatarows[p][f2].replace(',','.'));
var tmlt = TableDatarows[p][f3];
var slat = TableDatarows[p][f4];
var sola = TableDatarows[p][f5];
console.log('##=# caselist update ', casenr, perc, tmlt , slat );
if ( caselist.indexOf(casenr) == -1 ) {
caselist.push(casenr);
percentage.push(perc);
timeleft.push(tmlt);
SOtype.push(slat);
solaname.push(sola);
} else if ( percentage[ caselist.indexOf(casenr) ] < perc ) {
percentage[ caselist.indexOf(casenr) ] = perc;
timeleft[ caselist.indexOf(casenr) ] = tmlt;
SOtype[ caselist.indexOf(casenr) ] = slat;
solaname[ caselist.indexOf(casenr) ] = sola;
}
p++;
}
} else { ctr = 0; }
observer.observe(obstarget, obsconfig);
var timestring = gettimestr();
$('#timeframe').text('Last page load at: ' + timestring );
console.log('##=# calling colorlist ');
colorlist('#fff');
$('#framerow0').css('color', '#ccc').css('background-color', 'initial').attr('title', ' You have ' + ctr + ' active SLA/OLA\'s ');
if ( slalist === 'user') {
if (ctr == 1) {
$('#framerow0').text(' You have ' + ctr + ' running SLA/OLA ' ); //.css('background-color', '#fff')
} else {
$('#framerow0').text(' You have ' + ctr + ' running SLA/OLA\'s '); //.css('background-color', '#fff')
}
} else {
$('#framerow0').text(ctr +' SLA/OLA\'s running.').attr('title', ctr +' active SLA/OLA\'s for BE'); //.css('background-color', '#fff')
}
restoretasklistview();
function findcol3 (str) {
return TableHeaders.indexOf(str) ;
}
});
console.log('##=# slalist done');
}
function restoretasklistview() {
setTimeout( function() {
$.get( url2, function( data2 ) {
console.log( "#=#= url2 >0 is OK ",data2.length );
});
}, 1000);
}
function showhideframe() {
$('#jq_get').toggle();
}
function colorlist(clr) {
console.log('##=# loop cases ', caselist.length);
for ( var cntr = 0; cntr < caselist.length; cntr++ ) {
var casecolor = '#F4FFF4';
var stl = '0';
if ( percentage[cntr] > 10 ) { casecolor = '#E0FFE0'; stl = '1'; } // 10 #E0FFE0
if ( percentage[cntr] > 25 ) { casecolor = '#BAFFBA'; stl = '2'; } // 25 #BAFFBA
if ( percentage[cntr] > 35 ) { casecolor = '#90EE90'; stl = '3'; } // 35 #90EE90
if ( percentage[cntr] > 50 ) { casecolor = 'Khaki'; stl = '4'; } // 50 #F0E68C
if ( percentage[cntr] > 75 ) { casecolor = '#FFFF00'; stl = '5'; } // 75 #FFFF00
if ( percentage[cntr] > 83 ) { casecolor = '#FFD004'; stl = '6'; } // 83 #FFD004
if ( percentage[cntr] > 90 ) { casecolor = 'Orange'; stl = '7'; } // 90 #FFA500
if ( percentage[cntr] > 95 ) { casecolor = '#FF0502'; stl = '8'; } // 95 #FF0502
colorcase( caselist[cntr], casecolor, stl, percentage[cntr] , timeleft[cntr], SOtype[cntr], solaname[cntr] );
console.log('#=#= ', caselist[cntr], casecolor, percentage[cntr] , timeleft[cntr], SOtype[cntr], solaname[cntr]);
}
// $('img.list_nav').css('background-color', clr).css('border', '0px solid ' + clr);
$('#framerows').html('<span class="header" style="border-radius:5px;padding:5px 7px 7px 7px;">\
<span> Legend: </span>\
<span style="padding:0px 7px 0px 7px;"> SLA/OLA progress % </span><span \
class="my_list_sla_0" style="padding:0px 7px 0px 7px;"> 0-9</span><span \
class="my_list_sla_1" style="padding:0px 7px 0px 7px;">≥10</span><span \
class="my_list_sla_2" style="padding:0px 7px 0px 7px;">≥25</span><span \
class="my_list_sla_3" style="padding:0px 7px 0px 7px;">≥35</span><span \
class="my_list_sla_4" style="padding:0px 7px 0px 7px;">≥50</span><span \
class="my_list_sla_5" style="padding:0px 7px 0px 7px;">≥75</span><span \
class="my_list_sla_6" style="padding:0px 7px 0px 7px;">≥83</span><span \
class="my_list_sla_7" style="padding:0px 7px 0px 7px;">≥90</span><span \
class="my_list_sla_8" style="padding:0px 7px 0px 7px;">≥95 </span> </span> ');
$('#task_table td:contains("1 - Critical")').each( function() {
$(this).addClass('P1cell_');
$(this).find('div').css('background-color','red');
});
$('#task_table td:contains("2 - High")') .each( function() {
$(this).addClass('P2cell_');
$(this).find('div').css('background-color','orange');
});
var mrow = Number($('table#task_table').attr('total_rows'));
var orow = findcol('task_table','task.opened_at');
var urow = findcol('task_table','task.updated_on');
var trow = findcol('task_table','task.number');
var sdrow = findcol('task_table','task.short_description');
var row = 1;
console.log('##=# swow cases ' , mrow , orow);
var n = new Date();
while ( row < (mrow + 1)) {
cnr = $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + trow + ')').text();
odt = Date.parse( $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + orow + ')').text().replace(/-/g,' ') );
console.log('##=# swow case ' , cnr , row , mrow);
if (cnr){
if (GM_getValue(cnr + '_ETA')){
isnow = Number( Math.round(n.getTime()/3600000)); // /1000 = sec 60000 = min /3600000 = hrs
swdt = Number( Date.parse(GM_getValue(cnr + '_ETA').replace(/-/g,' '))/3600000 );
console.log('##=# swow case found '+ cnr + ' ' + ( swdt - isnow ) + ' hrs ' ) ;
if ( (swdt - isnow) < 0 ) {
if ( (swdt - isnow) < 0 ) {
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + sdrow + ')').css('border-left','1px solid grey').attr('title','Do a SWOW update!!'); //.css('padding-left','5px').css('padding-right','5px');
}
if ( (swdt - isnow) < -8 ) {
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + sdrow + ')').css('border-left','3px solid yellow').attr('title','Do a SWOW update!!'); //.css('padding-left','5px').css('padding-right','5px');
}
if ( (swdt - isnow) < -12 ) {
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + sdrow + ')').css('border-left','3px solid orange').attr('title','Do a SWOW update!!'); //.css('padding-left','5px').css('padding-right','5px');
}
if ( (swdt - isnow) < -16 ) {
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + sdrow + ')').css('border-left','3px solid red').attr('title','Do a SWOW update!!'); //.css('padding-left','5px').css('padding-right','5px');
}
}
}
var caseage = parseInt((n - odt)/(24*3600*1000));
if ( caseage > 30 ) {
var t = $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + orow + ')').css('color','red').attr('style').replace('red;','red !important;');
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + orow + ')').attr('style', t ).attr('title','Case is in backlog!').addClass('redlink');
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + trow + ')').attr('title','Case is in backlog!').find('a').addClass('redlink').attr('style', t );
}
}
row++;
}
console.log('##=# colorlist done. ');
}
function colorcase (casenr, color, stl, perc, tmlt, slat, sola ) {
var row = 1;
tmlt = slat + ': ' + sola + ' is at ' + perc + '%\nBusiness time left is: ' + tmlt;
var trow = findcol('task_table','task.number');
var sdrow = findcol('task_table','task.short_description');
// console.log('##=# color case ' , casenr, color , row, trow);
var exst = $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ')').length;
while ( exst > 0 ) {
if ( $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + trow + ')').text() == casenr ) {
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ')').find('td').each( function() {
$(this).attr('title',tmlt);
});
console.log('##=# color case Match' , casenr, color , row, trow);
$('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ')').attr('title',tmlt).addClass('my_list_sla_' + stl).removeClass('my_list').removeClass('list_even').removeClass('list_odd');
// $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + sdrow + ')').prepend('<div style="background-color:' + color + ';" class="list2_cell_background"></div>');
}
row++;
exst = $('#task_table > tbody:nth-child(2) > tr:nth-child(' + row + ')').length;
}
}
function findcol (id, str) {
var trow = 1;
var res = 0;
var max = $('#' + id +' > thead:nth-child(1) > tr:nth-child(1) > th').length +1;
// console.log('##=# columns ' , max , trow, res );
while (res === 0 && trow < max ) {
var th_title = $('#' + id +' > thead:nth-child(1) > tr:nth-child(1) > th:nth-child(' + trow + ')').attr('glide_field');
// console.log('##=# case found ' , th_title );
if ( th_title == str ) { res = trow; }
trow++;
}
return res;
}
function gettimestr() {
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
m = checkTime(m);
var timestring = h + ":" + m + " " ;
return timestring;
}
function checkTime(i) {
if (i<10) {i = "0" + i;} // add zero in front of numbers < 10
return i;
}
});
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = navigation frame =
// = =
if ( script === '/navigator.do' ) {
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
GM_addStyle(' .menu_td { border: 1px solid #fff; border-radius:3px; } ');
GM_addStyle(' .menu_td:hover { border: 1px solid #000; border-radius:3px; background-color:#DFE; cursor:pointer;} ');
GM_addStyle(' a.menu:hover { text-decoration:none !important;} ');
$('a.menu').each( function() {
if ( $(this).parent().is('h3') ) {
$(this).parent().parent().addClass('menu_td').on('click', function () {
$(this).find('a')[0].click();
});
} else {
$(this).parent().parent().parent().addClass('menu_td').on('click', function () {
$(this).find('a')[0].click();
});
}
});
$('.menu_td').each( function() {
$(this).hover( function () {
$(this).find('a').addClass('colored');
}, function () {
$(this).find('a').removeClass('colored');
});
});
setTimeout(function() {
var x = 0;
$('a.menu').each( function() {
var itemurl = ( $(this).is('[href]') ) ? $(this).attr('href') : 'no href';
x++;
// console.log('##=## navigator.do menu urls ', itemurl);
if ( itemurl.indexOf('getMyAssignments') > -1 && itemurl.indexOf('task_list.do') > -1 && itemurl.indexOf('sysparm_view=') > -1 ) {
itemurl = itemurl.replace('^EQ^&sysparm_view=','^u_majorISEMPTY^EQ&sysparm_view=');
$(this).attr('href',itemurl);
console.log('##=## Change href ' + x + ' ' + itemurl , $(this).attr('href') );
}
});
$('a.menu_').each( function() {
var itemurl = ( $(this).is('[href]') ) ? $(this).attr('href') : 'no href';
x++;
// console.log('##=## navigator.do menu urls ', itemurl);
if ( itemurl.indexOf('getMyAssignments') > -1 && itemurl.indexOf('task_list.do') > -1 && itemurl.indexOf('sysparm_view=') > -1 ) {
itemurl = itemurl.replace('^EQ^&sysparm_view=','^u_majorISEMPTY^EQ&sysparm_view=');
$(this).attr('href',itemurl);
console.log('##=## Change href ' + x + ' ' + itemurl , $(this).attr('href') );
}
});
}, 2000);
console.log('##=## navigator.do done ');
$('span.icon-star').css('display','none');
$('span.icon-star-empty').css('display','none');
// setTimeout(function() {
// $('a.menu:nth-child(1) > font:nth-child(1)').each( function() {
// // $(this).attr('style', 'color:#ffff26 !important;');
// $(this).addClass('yellow');
// });
// console.log('# how many values need color ' + $('a.menu:nth-child(1) > font:nth-child(1)').length );
// }, 2000);
// setInterval(function() {
// $('a.menu:nth-child(1) > font:nth-child(1)').each( function() {
// // $(this).attr('style', 'color:#ffff26 !important;');
// $(this).addClass('yellow');
// });
// console.log('# how many values need color ' + $('a.menu:nth-child(1) > font:nth-child(1)').length );
// }, 60000);
});
}
// ==============================================================================================================================================================
// =
// ==============================================================================================================================================================
// = DD Webex helper =
// = =
if ( script.indexOf('orion/meeting/schedule') > -1 ){
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
var url = window.location.href.split('\?')[1].split('&');
for ( x in url ) {
if ( url[x].indexOf('confName' ) > -1 ) { $('#input-confName').val( decodeURIComponent( url[1].split('=')[1] )); }
if ( url[x].indexOf('scheduler-who') > -1 ) { $('#scheduler-who' ).val( url[x].split('=')[1] ); }
}
});
}
// ==============================================================================================================================================================
// =
// ==============================================================================================================================================================
// = Fortinet helper =
// = =
if ( script === '/Main.aspx' || script === '/Ticket/ViewTickets.aspx' || script === '/Ticket/CreateTicket.aspx' ) {
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
var ref = document.referrer;
if(ref.indexOf("ticketId=") > -1) {
var h1 = ref.split('&')[1];
if ( h1.indexOf("ticketId=") == -1 ) { h1 = ref.split('&')[2]; }
console.log('# ', h1);
// alert(h1);
GM_setValue('fortinetcase', h1.split('=')[1] );
h1 = $('#ctl00_Content_dvTicket > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > a:nth-child(1)').attr('href') + '&' + h1;
$('#ctl00_Content_dvTicket > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > a:nth-child(1)').attr('href', h1);
$('#ctl00_Content_dvTicket > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > a:nth-child(1)')[0].click();
} else {
if ( GM_getValue('fortinetcase') && script === 'Ticket/ViewTickets.aspx' ) {
var h1 = GM_getValue('fortinetcase');
console.log('# ', h1);
// alert(h1);
GM_deleteValue('fortinetcase');
var ietslater0 = setTimeout( function() { // seems input is not there immeadiatly after pageload
$('input#ctl00_Content_uc_tickets_txtSN').val(h1);
$('a#ctl00_Content_uc_tickets_lbtnSearch')[0].click();
var ietslater1 = setTimeout( function() { // wait for case list to show before we click it.
$('#ctl00_Content_uc_tickets_gvBasic > tbody:nth-child(1) > tr:nth-child(2)')[0].click();
}, 4000 );
}, 1000);
} else {
if (script === 'Ticket/CreateTicket.aspx') {
if ( GM_getValue('ourcase') ) {
var ourcase = GM_getValue('ourcase');
var oursubj = GM_getValue('oursubj');
var blijfproberen = setInterval( function() {
if ($('#ctl00_Content_UC_TicketWizard_BasicStep_UC_TicketInfo_TB_Title') ) { $('#ctl00_Content_UC_TicketWizard_BasicStep_UC_TicketInfo_TB_Title').val(oursubj); } //.length > 0
if ($('#ctl00_Content_UC_TicketWizard_CompleteStep_L_ticketId') ) {
var casenr = $('#ctl00_Content_UC_TicketWizard_CompleteStep_L_ticketId').text();
GM_setValue('newcase', 'fortinet,' + casecreated );
console.log ('# stored ourcase@fortinet ' + 'fortinet,' + casecreated );
alert('Stored case@ ' + 'fortinet,' + casecreated );
GM_deleteValue('fortinetcase');
GM_deleteValue('ourcase');
GM_deleteValue('oursubj');
}
}, 1000 );
}
}
}
}
});
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = tpcase helper1 add our case =
// = =
if ( script.indexOf('/case') > -1 || script.indexOf('/ServiceRequestTool/scm/mgmt/') > -1 || script === '/servicecenter/createSR/' || script === '/app/ask' || script.indexOf('TechnicalCaseEditPage') > -1 || script.indexOf('casemanager') > -1 || script.indexOf('500/') > -1 || script === '/WorkOrder.do' || script.indexOf('supportId%2CCreateServiceRequestId') > -1 || script.indexOf('angora-cp-gui-eu') > -1 ) {
// ==============================================================================================================================================================
console.log('#=#=#=# tp helper');
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
if (typeof unsafeWindow == "undefined") {
unsafeWindow = window;
console.log('#=#=#=# unsafeWindow is not defined');
}
var casedt = new Date( GM_getValue('casedt') );
var dt = new Date();
var ourcase = GM_getValue('ourcase');
var oursubj = GM_getValue('oursubj');
var ourcust = GM_getValue('ourcust');
var ourseri = GM_getValue('ourseri');
console.log('#=#=#=# cookie too old? ', (dt - casedt) );
if ( (dt - casedt) < 36000000 ) {
var done = 0;
// var loggedin = $('#gsft_full_name',unsafeWindow.parent.document).text();
$('body').append('<div id="floattest" style="position:fixed;right:30px;bottom:20px;border: 1px solid #000;padding:5px;background-color:#fff;opacity:.6;border-radius:10px;" title="Click to clear" ><div>');
$('#floattest').append('<b><font style="color:blue;">ITSM+</font><br><font style="color:#000;"> Case: </b>' + ourcase + ' <b>Subj: </b>' + oursubj + ' <b>Cust: </b>' + ourcust + ' <b>Serial: </b>' + ourseri + '</b></font>');
$('#floattest').on('mouseover', function() {
var wait = setTimeout( function() {
if ( $('#floattest').css('right') != null && $('#floattest').css('right') === '30px' ) {
$('#floattest').css('right','auto').css('left','30px');
} else {
$('#floattest').css('right','30px').css('left','auto');
}
},2500);
});
$('#floattest').click( function() {
GM_deleteValue('ourcase');
GM_deleteValue('oursubj');
GM_deleteValue('ourcust');
GM_deleteValue('ourseri');
$('#floattest').remove();
});
var tadaa = setInterval( function() {
console.log('# calling checkformloaded every 1500ms');
checkformloaded();
}, 1500);
console.log ('# ourcase= ' + ourcase , ourcust , ourseri);
}
function checkformloaded() {
console.log('# testing form values presence', done );
if ( $("h2:contains('Thank You')").length > 0 ) { getcase_emc(); }
if ( $("p.ng-binding:contains('has been submitted successfully')").length > 0 ) { getcase_cisco(); }
if ( $('input#ext-comp-1034').length > 0 ) { done = 1; addparas_emc(); }
if ( $('input#ext-comp-1030').length > 0 ) { done = 1; addparas_emc(); }
if ( $('input#additionalInfoTrackingNumberInput').length > 0 ) { done = 1; addparas_cisco0(); }
if ( $('input#caseTitle').length > 0 ) { done = 1; addparas_cisco1(); }
if ( $('input[id*=Incident\\.Subject]').length > 0 ) { done = 1; addparas_infoblox();}
if ( $('input#cas14').length > 0 ) { done = 1; addparas_nimsoft(); }
if ( $('input#input_synopsis').length > 0 ) { done = 1; addparas_juniper(); }
if ( $('input#UDF_CHAR2').length > 0 ) { done = 1; addparas_evercom(); }
if ( $('form#supportCase').length > 0 ) { done = 1; addparas_F5(); }
if ( $('input#srdevice').length > 0 ) { done = 1; addparas_checkp0(); }
if ( $('input#srsubject').length > 0 ) { done = 1; addparas_checkp1(); }
if ( $('input#srsubject').length > 0 ) { done = 1; addparas_checkp1(); }
if ( $('input[name*=customerrefnum]').length > 0 ) { done = 1; addparas_checkp2(); }
if ( $('input[name*="dbfield:3:__raw_custom"]').length > 0 ) { done = 1; addparas_ntt() ; }
if ( $('input#caseEditPage\\:csEForm\\:csEPageBlock2\\:csEPageBlockSection1\\:j_id447\\:csCustRefNum').length > 0 ) { done = 1; addparas_bluecoat(); }
console.log('# testing form values presence all tried res: ', done );
if (done == 1) {
console.log('# found, try again in 1500ms');
// clearInterval( tadaa );
// GM_deleteValue('ourcase')
// GM_deleteValue('oursubj')
// GM_deleteValue('ourcust')
// alert('Case can be put into ITSM')
} else {
console.log('# not found, try again in 1500ms');
}
}
function addparas_ntt() {
console.log ('# set ourseri 4 checkpoint ');
// name="FPAR_related_configuration_items__filter"
// name="dbfield:3:__raw_custom__:__single__:summary" size="80"
if ( oursubj ) { $('input[name="dbfield:3:__raw_custom__:__single__:summary"]').val(oursubj); }
if ( ourseri ) { $('input[name="FPAR_related_configuration_items__filter"]').val(ourseri); }
}
function addparas_checkp0() {
console.log ('# set ourseri 4 checkpoint ');
if ( ourseri ) { $('input#srdevice').val(ourseri); }
}
function addparas_checkp1() {
console.log ('# set oursubj 4 checkpoint ');
if ( $('input#srsubject').val() === '') { $('input#srsubject').val(oursubj); }
}
function addparas_checkp2() {
console.log ('# set other 4 checkpoint ');
$('td.sstFieldTitle:nth-child(2) > input:nth-child(1)').prop('checked');
// $('input.multiEditInputText').val(oursubj);
if ( $('input.multiEditInputText').val() === '') { $('input.multiEditInputText').val(oursubj); }
$('.contactInformation > tbody:nth-child(1) > tr:nth-child(14) > td:nth-child(2) > input:nth-child(1)').val(ourcase);
}
function addparas_bluecoat() {
console.log ('# set ourcase 4 bluecoat ');
$('input#caseEditPage\\:csEForm\\:csEPageBlock2\\:csEPageBlockSection1\\:j_id447\\:csCustRefNum').val(ourcase);
if ( $('input#caseEditPage\\:csEForm\\:csEPageBlock2\\:csEPageBlockSection2\\:csSubj').val() === '') { $('input#caseEditPage\\:csEForm\\:csEPageBlock2\\:csEPageBlockSection2\\:csSubj').val(oursubj); }
}
function addparas_infoblox() {
console.log ('# set ourcase 4 infoblox ');
// rn_TextInput_19_Incident\\.CustomFields\\.CO\\.customer_ticket_reference rn_TextInput_18_Incident\\.CustomFields\\.CO\\.customer_ticket_reference rn_BloxTextInput_20_Incident.CustomFields.CO.rma_serial_number_txt
$('input[id*=customer_ticket_reference]').val(ourcase);
if ( $('input[id*=Incident\\.Subject]').val() === '') { $('input[id*=Incident\\.Subject]').val('[' + ourcust + ']' +oursubj); }
if ( ourseri ) { $('input[id*=rma_serial_number_txt]').val(ourseri); }
}
function addparas_emc() {
console.log ('# set ourcase 4 emc ');
var ietslater = setTimeout( function() {
if ( $('input#ext-comp-1034').length > 0 ) { if ( $('input#ext-comp-1034').val() === '') { $('input#ext-comp-1034').val(ourcase); } }
if ( $('input#ext-comp-1030').length > 0 ) { if ( $('input#ext-comp-1030').val() === '') { $('input#ext-comp-1030').val(ourcase); } }
if ( $('input#problemSummary').val() === '') { $('input#problemSummary').val(oursubj); }
}, 5000);
}
function addparas_cisco0() {
console.log ('# set ourcase 4 cisco ');
$('input#additionalInfoTrackingNumberInput').val( ourcase );
if ( $('input#problemPageTitle').val() === '') { $('input#problemPageTitle').val(oursubj); }
var ietslater = setTimeout( function() {
$('input#additionalInfoTrackingNumberInput').val( ourcase );
if ( $('input#problemPageTitle').val() === '') { $('input#problemPageTitle').val(oursubj); }
}, 4000);
console.log ('# ourcase@cisco set to ' + $('input#additionalInfoTrackingNumberInput').val() );
}
function addparas_cisco1() {
console.log ('# set ourcase 4 cisco ');
$('input[name*=trackingNumber]').val( ourcase );
console.log ('# caseTitle@cisco set to ' + $('input#caseTitle').val().length );
if ( $('input#caseTitle').val() === '') { $('input#caseTitle').val(oursubj); }
var ietslater = setTimeout( function() {
$('input[name*=trackingNumber]').val( ourcase );
if ( $('input#caseTitle').val() === '') { $('input#caseTitle').val(oursubj); }
// if ( $('input#caseTitle').length == 0 ) { $('input#caseTitle').val(oursubj); }
}, 4000);
console.log ('# ourcase@cisco set to ' + $('input[name*=trackingNumber]').val() );
}
//
//
// our ref $('input[name*=trackingNumber]')
//
// https://mycase.cloudapps.cisco.com/case
// casenr = p.ng-binding:nth-child(1) > a:nth-child(1)
//
function addparas_juniper() {
console.log ('# set ourcase 4 juniper ');
$('input#customerTrackingNumber').val(ourcase);
$('input#serialNumber').val(ourseri);
if ( $('input#input_synopsis').val() === '') { $('input#input_synopsis').val(oursubj); }
var ietslater = setTimeout( function() {
$('input#customerTrackingNumber').val(ourcase);
$('input#serialNumber').val(ourseri);
if ( $('input#input_synopsis').val() === '') { $('input#input_synopsis').val(oursubj); }
$('select#technicalCategory' ).val('ZTEC'); // Technical Service Request
$('select#followUpMethod' ).val('EFUL'); // Email full text update
$('div#srpriority > span.radio_block1:nth-child(3)').find('input').attr('checked',true); // span.radio_block1:nth-child(3)
console.log ('# set ourcase 4 juniper radio done');
}, 5000);
}
function addparas_nimsoft() {
console.log ('# set ourcase 4 nimsoft ');
$('input#cas14').val(oursubj);
}
function addparas_evercom() {
console.log ('# set ourcase 4 evercom ');
$('input#title').val(oursubj);
$('input#UDF_CHAR2').val(ourcust);
}
function addparas_F5() {
console.log ('# set ourcase 4 F5 ');
$('input#title').val(oursubj);
$('input#serialNumber').val(ourseri);
}
function getcase_emc() {
var casecreated = $("h2:contains('Thank You')").parent().find('b').text() || '';
if (casecreated) {
GM_setValue('newcase', 'emc,' + casecreated );
console.log ('# stored ourcase@emc ' + 'emc,' + casecreated );
}
}
function getcase_cisco() {
var casecreated = $('div.modal-body > p.ng-binding:nth-child(1)').find('a.ng-binding').text();
if (casecreated) {
GM_setValue('newcase', 'cisco,' + casecreated );
console.log ('# stored ourcase@cisco ' + 'cisco1,' + casecreated );
$('#floattest').html('<b><font style="color:blue;">ITSM+</font><br><font style="color:#000;"> Cisco case: </b>' + casecreated + ' created. ');
}
}
});
// EMC input#ext-comp-1034 servicecenter/createSR/ input#problemSummary
// https://support.emc.com/servicecenter/createSR/
// Cisco 1 ServiceRequestTool/scm/mgmt/contract
// Cisco 2 input#additionalInfoTrackingNumberInput ServiceRequestTool/scm/mgmt/problem
// Cisco 3 https://tools.cisco.com/ServiceRequestTool/scm/mgmt/finish
// Cisco 4 https://tools.cisco.com/ServiceRequestTool/scm/mgmt/case/srsubmit?srId=636988219 $('div#caseSubmittedMessage > a:nth-child(1)').text()
//
//
// InfoBlox input#rn_TextInput_18_Incident.CustomFields.CO.customer_ticket_reference app/ask rn_TextInput_10_Incident.Subject
// Nimsoft not 500/e?retURL=%2F500%2Fo input#cas14
// Juniper input#customerTrackingNumber CaseManager.html input#input_synopsis
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = tpcase helper2 capture casenr =
// = =
if ( script.indexOf('/case') > -1 || script.indexOf('ServiceRequestTool') > -1 || script.indexOf('serviceordertool') > -1 || script.indexOf('servicecenter/createSR/') > -1 || script.indexOf('ask_confirm') > -1 || script.indexOf('casemanager') > -1 || script.indexOf('/500') > -1 || script.indexOf('supportId%2CCreateServiceRequestId') > -1 ) {
// ==============================================================================================================================================================
// infoblox https://support.infoblox.com/app/ask_confirm/i_id/587954 div#rn_PageContent > a
console.log ('# ourcase@.. ' + window.location.href );
if ( window.location.href.indexOf('ServiceRequestTool') > -1 && window.location.href.indexOf('srId=') > -1 ) {
var casecreated = window.location.href.split('=')[1];
if (casecreated) {
GM_setValue('newcase', 'cisco,' + casecreated );
console.log ('# stored ourcase@cisco ' + 'cisco,' + casecreated );
}
}
if ( window.location.href.indexOf('/case') > -1 ) {
var casecreated = $('p.ng-binding:nth-child(1) > a:nth-child(1)').text();
if (casecreated) {
GM_setValue('newcase', 'cisco,' + casecreated );
console.log ('# stored ourcase@cisco ' + 'cisco1,' + casecreated );
}
}
if ( window.location.href.indexOf('ask_confirm') > -1 ) {
console.log ('# storing ourcase@infoblox ');
var casenr = $('div#rn_PageContent').find('a').text().replace('#','') || 'Could not find case nr on page' ;
var caseurl = 'https://support.infoblox.com' + $('div#rn_PageContent').find('a').attr('href') || 'Could not find case url on page' ;
var casecreated = casenr + ',' + caseurl;
if (casenr) {
GM_setValue('newcase', 'infoblox,' + casecreated );
console.log ('# stored ourcase@infoblox ' + 'infoblox,' + casecreated );
}
}
if ( window.location.href.indexOf('casemanager/create') > -1 ) {
var casecreated = $('div.bodyWrapper').find('a').text() || 'Could not find case nr on page' ;
if (casecreated) {
GM_setValue('newcase', 'juniper,' + casecreated );
console.log ('# stored ourcase@juniper ' + 'juniper,' + casecreated );
}
}
// Bluecoat
if ( window.location.href.indexOf('na32.sales') > -1 ) {
var caseurl = window.location.href;
var casenr = $('h2.pageDescription').text() || 'Could not find case nr on page' ;
var casecreated = casenr + ',' + caseurl;
if (casenr) {
GM_setValue('newcase', 'bluecoat,' + casecreated );
console.log ('# stored ourcase@bluecoat ' + 'bluecoat,' + casecreated );
}
}
// EMC
if ( window.location.href.indexOf('createSR') > -1 ) {
// var casecreated = $('div#ext-comp-1103 > b:nth-child(2)').text() || '' ; // #ext-comp-1103 > b:nth-child(2) #ext-comp-1099 > b:nth-child(2)
// if ( casecreated === '' ) { casecreated = $('div#ext-comp-1099 > b:nth-child(2)').text() || '' ; }
// if ( casecreated === '' ) { casecreated = altern;}
if ( $("h2:contains('Thank You')").length > 0 ) {var casecreated = $("h2:contains('Thank You')").parent().find('b').text() || ''; }
if (casecreated) {
GM_setValue('newcase', 'emc,' + casecreated );
console.log ('# stored ourcase@emc ' + 'emc,' + casecreated );
}
}
if ( window.location.href.indexOf('create-ticket') > -1 ) {
var caseurl = $('div.section_content:nth-child(1) > div:nth-child(1) > h2:nth-child(1)').text();
var casenr = $('div.section_content:nth-child(1) > div:nth-child(1) > ul:nth-child(2) > li:nth-child(1) > a:nth-child(1)').attr('htef');
var casecreated == casenr + ',' + caseurl;
GM_setValue('newcase', 'NTT,' + casecreated );
console.log ('# stored ourcase@NTT ' + 'NTT,' + casecreated );
}
// div.section_content:nth-child(1) > div:nth-child(1) > h2:nth-child(1) https://portal.ntt.eu/angora-cp-gui-eu?action=create-ticket
// div.section_content:nth-child(1) > div:nth-child(1) > ul:nth-child(2) > li:nth-child(1) > a:nth-child(1)
// RMA cisco
if ( window.location.href.indexOf('serviceordertool') > -1 && window.location.href.indexOf('=') > -1 ) {
var casecreated = window.location.href.split('=')[1];
GM_setValue('newrma', 'cisco,' + casecreated );
console.log ('# stored ourRMA@cisco ' + 'cisco,' + casecreated );
}
var ietslater = setTimeout( function() {
if ( GM_getValue('newcase') ) {
$('#floattest > b:first-child(1)').insertAfter(' <b> Case nr ' + casecreated + ' found, case creation coookie created </b>');
$('#floattest').css('opacity','1.0').css('left','auto').css('right','auto').css('width','90%');
GM_deleteValue('ourcase')
GM_deleteValue('oursubj')
GM_deleteValue('ourcust') // alert('Case can be put into ITSM')
}
}, 1000);
}
// ==============================================================================================================================================================
// ==============================================================================================================================================================
// = include exteral reference script =
// = =
if ( script === '/u_ext_ref_no.do' ) {
// ==============================================================================================================================================================
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
GM_addStyle(' .mybut { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff;padding:3px 4px 3px 4px;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
GM_addStyle(' .mybut:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important; }');
var u = $('#u_ext_ref_no\\.u_reference_type option:selected').text().trim();
console.log('# tpcase = ' + u);
if ( $('#label\.u_ext_ref_no\.u_task > label:nth-child(2)').text() === 'Task:') {
var oldnew = 2; // old #label\.u_ext_ref_no\.u_task > label:nth-child(2).text()
} else {
var oldnew = 1; // new #label\.u_ext_ref_no\.u_task > label:nth-child(1).text()
}
if ( u === '' || u === '-- None --') {
$('#label\\.u_ext_ref_no\\.u_reference_number > label:nth-child(' + oldnew + ')').text('Case Reference:');
$('#label\\.u_ext_ref_no\\.u_description > label:nth-child(' + oldnew + ')').text('Vendor:');
$('sys_original.u_ext_ref_no.u_reference_type').val('Vendor reference number');
$('#u_ext_ref_no\\.u_reference_type' ).val('Vendor reference number');
unsafeWindow.onChange('u_ext_ref_no.u_reference_type');
}
$('#u_ext_ref_no\\.u_reference_type').on('change', function() { reftypchng( this.value ); } );
reftypchng($('#u_ext_ref_no\\.u_reference_type').val());
// <tr id="element.u_ext_ref_no.u_company" style="display:none;"
//
$('#u_ext_ref_no\\.u_url').css('display','inline');
$('#u_ext_ref_no\\.u_url_link').css('display','none');
$('#u_ext_ref_no\\.u_url_lock').css('display','inline');
$('#u_ext_ref_no\\.u_url_unlock').css('display','none');
$('#u_ext_ref_no\\.u_description').after(' Or: <select id="desc" name="desc" style="direction:ltr;width:160px;width:250px">\
<option value="0" ></option>\
<option value="1" > avaya </option>\
<option value="2" > bluecoat </option>\
<option value="4" > cisco </option>\
<option value="5" > checkpoint </option>\
<option value="6" > emc </option>\
<option value="15"> evercom </option>\
<option value="7" > f5 </option>\
<option value="8" > fortinet </option>\
<option value="9" > infoblox </option>\
<option value="10"> juniper </option>\
<option value="11"> nimsoft </option>\
<option value="12"> NTT </option>\
<option value="13"> palo alto </option>\
<option value="14"> pulse secure</option>\
<option value="16"> CA </option>\
</select>');
$('#desc').on('change', function() { deschng( this.value ); } );
$('<tr><td colspan=2><hr>The fields used in the ITSM scripts are:<p><ul>\
<li><b>reference</b>, holding the external reference. RMA nr, Case nr, Customer reference, etc </li>\
<li><b>Reference type</b>, which is preset to "Vendor reference number".</li>\
<li><b>Vendor</b>, where you can enter a vendor or select one from a list of predefined vendors.</li>\
<li><b>URL</b>, possibly the link to your case that we can display above the comments.</li>\
</ul>The field <b>Company</b> is now hidden and is best not used, since it points to the list of our customers rather than our vendors.<br>\
And of course we should be able to log a ticket for every vendor, not just the ones that happen to appear in the customers list.<p><hr>\
Currently I have these vendors in my dropdown list, and only for avaya, cisco, emc, F5 fortinet, infoblox and NTT I have a base url.<ul>\
<li>avaya</li>\
<li>bluecoat</li>\
<li>cisco</li>\
<li>checkpoint</li>\
<li>emc</li>\
<li>evercom</li>\
<li>f5</li>\
<li>fortinet</li>\
<li>infoblox</li>\
<li>juniper</li>\
<li>nimsoft</li>\
<li>NTT</li>\
<li>palo alto</li>\
<li>Pulse Secure</li>\
<li>CA</li>\
</ul>\
If you see your vendor missing please tell me, if possible provide me wit the base url for their case management<br>\
<hr>\
</td></tr>').insertAfter( $('#element\\.u_ext_ref_no\\.u_url') );
$('tr#element\\.u_ext_ref_no\\.u_company').css('display','none');
$('input#u_ext_ref_no\\.u_reference_number').focus().parent().removeClass('flex-row');
$('input#u_ext_ref_no\\.u_description' ).parent().removeClass('flex-row');;
if ( GM_getValue('newcase') && GM_getValue('newcase') !== '' && $('#u_ext_ref_no\\.u_reference_number').val() === '' ) {
var p = GM_getValue('newcase').split(',');
console.log('# newcase = ' + p[1] +' '+ p[0] +' array=['+ p +']');
GM_deleteValue('newcase');
console.log('# newcase deleted' );
var vndr = getVendorID(p[0]);
if (p[2]) { unsafeWindow.g_form.setValue('u_ext_ref_no.u_url', p[2] ); }
$('#u_ext_ref_no\\.u_reference_number').val( p[1] );
console.log('# casenr set' );
console.log('# selecting option ' );
$('select#desc').val( vndr );
console.log('# option selected' );
deschng(vndr);
console.log('# url adjusted' );
$('sys_original.u_ext_ref_no.u_reference_type').val('Vendor reference number');
$('#u_ext_ref_no\\.u_reference_type' ).val('Vendor reference number');
$('#label\\.u_ext_ref_no\\.u_reference_number > label:nth-child(' + oldnew + ')').text('Case Reference:');
$('#label\\.u_ext_ref_no\\.u_description > label:nth-child(' + oldnew + ')').text('Vendor:');
}
if ( GM_getValue('newrma') ) {
var p = GM_getValue('newrma').split(',');
var vndr = getVendorID(p[0]);
$('select#desc').val( vndr );
console.log('# option selected' );
deschng(vndr);
GM_deleteValue('newrma');
console.log('# newrma deleted' );
if (p[1]) {$('#u_ext_ref_no\\.u_reference_number').val( p[1] );}
if (p[2]) { unsafeWindow.g_form.setValue('u_ext_ref_no.u_url', p[2] ); }
$('sys_original.u_ext_ref_no.u_reference_type').val('Vendor reference number / RMA');
$('#u_ext_ref_no\\.u_reference_type' ).val('Vendor reference number / RMA');
$('#label\\.u_ext_ref_no\\.u_reference_number > label:nth-child(' + oldnew + ')').text('RMA Reference:');
$('#label\\.u_ext_ref_no\\.u_description > label:nth-child(' + oldnew + ')').text('Vendor:');
console.log('# newrma done' );
}
$('button.action_context').addClass('mybut').css('border-color','#FFF');
function getVendorID(vendor) {
var vid=0;
if (vendor === 'newrma') { vid = 0; }
if (vendor === 'avaya') { vid = 1; }
if (vendor === 'bluecoat') { vid = 2; }
if (vendor === 'cisco') { vid = 4; }
if (vendor === 'checkpoint') { vid = 5; }
if (vendor === 'emc') { vid = 6; }
if (vendor === 'evercom') { vid = 15; }
if (vendor === 'f5') { vid = 7; }
if (vendor === 'fortinet') { vid = 8; }
if (vendor === 'infoblox') { vid = 9; }
if (vendor === 'juniper') { vid = 10;}
if (vendor === 'nimsoft') { vid = 11;}
if (vendor === 'NTT') { vid = 12;}
if (vendor === 'palo alto') { vid = 13;}
if (vendor === 'pulse secure') { vid = 14;}
if (vendor === 'CA') { vid = 16;}
console.log('# vendor ', vendor , ' vendorID ', vid );
return vid;
}
setTimeout(function(){
$('tr#element\\.u_ext_ref_no\\.u_company').css('display','none');
$('input#u_ext_ref_no\\.u_reference_number').focus();
}, 500);
function reftypchng(opt) {
var t = $('#u_ext_ref_no\\.u_reference_type option:selected').text().trim();
console.log('#=#=#=# ', opt, t, oldnew);
$('#label\\.u_ext_ref_no\\.u_description > label:nth-child(' + oldnew + ')').text('Description:');
if ( opt === 'Client reference number' ) { // new old
$('#label\\.u_ext_ref_no\\.u_reference_number > label:nth-child(' + oldnew + ')').text('Client Reference:'); // #label\.u_ext_ref_no\.u_reference_number > label:nth-child(1) #label\.u_ext_ref_no\.u_reference_number > label:nth-child(2)
}
if ( opt === 'Vendor reference number / RMA' ) {
$('#label\\.u_ext_ref_no\\.u_reference_number > label:nth-child(' + oldnew + ')').text('RMA Reference:');
$('#label\\.u_ext_ref_no\\.u_description > label:nth-child(' + oldnew + ')').text('Vendor:');
}
if ( opt === 'Vendor reference number' ) {
$('#label\\.u_ext_ref_no\\.u_reference_number > label:nth-child(' + oldnew + ')').text('Case Reference:');
$('#label\\.u_ext_ref_no\\.u_description > label:nth-child(' + oldnew + ')').text('Vendor:');
}
// #label\.u_ext_ref_no\.u_reference_number > label:nth-child(2) #label\.u_ext_ref_no\.u_description > label:nth-child(2)
}
function deschng(opt) {
var t = $('#desc option:selected').text().trim();
u = $('#u_ext_ref_no\\.u_reference_type option:selected').text().trim();
console.log('#=#=#=# opt=' + opt +' t='+ t +' u='+ u);
$('#u_ext_ref_no\\.u_description').val(t);
var urlstr = [];
if ( u === 'Vendor reference number' ) {
urlstr[ 1] = 'https://support.avaya.com/service-requests/ticket.action?srNum={case}'; // avaya
urlstr[ 2] = ''; // bluecoat
urlstr[ 3] = ''; // 'https://tools.cisco.com/ServiceRequestTool/query/QueryCaseSearchAction.do?caseType=ciscoServiceRequest&method=doQueryByCase&SRNumber={case}'; // cisco old
urlstr[ 4] = 'https://mycase.cloudapps.cisco.com/{case}'; // cisco
urlstr[ 5] = 'https://uc.checkpoint.com/usercenter/portal/media-type/html/role/usercenterUser/page/default.psml/js_pane/supportId%2CserviceRequestDetailsId?srId={case}'; // checkpoint
urlstr[ 6] = 'https://onlinesupport.emc.com/SRDetails?srNumber={case}'; // emc
urlstr[ 7] = 'https://websupport.f5.com/casemanager/case.do?caseId={case}'; // f5
urlstr[ 8] = 'https://partners.fortinet.com/FortiPartnerPortal/Application/Redirect.do?oid=4&ticketId={case}'; // fortinet
urlstr[ 9] = 'https://support.infoblox.com/app/account/overview'; // infoblox
urlstr[10] = 'https://casemanager.juniper.net/casemanager/#/cmdetails/{case}'; // juniper
urlstr[11] = 'https://na4.salesforce.com/secur/login_portal.jsp?orgId=00D3000000001oV&portalId=06060000000D3gX'; // nimsoft
urlstr[12] = 'https://portal.ntt.eu/angora-cp-gui-eu?action=view-tickets&id={case}'; // NTT
urlstr[13] = ''; // palo alto
urlstr[14] = ''; // Pulse Secure
urlstr[15] = 'http://eservice.evercom.be/WorkOrder.do?woMode=viewWO&woID={case}'; // evercom
urlstr[16] = 'https://support.ca.com/irj/portal/implsvccasedetails?issueNo={case}'; // CA
}
if ( u === 'Vendor reference number / RMA' ) {
urlstr[ 4] = 'https://tools.cisco.com/support/serviceordertool/orderDetails.svo?orderNumber={case}'; // cisco
urlstr[10] = 'https://casemanager.juniper.net/casemanager/#/rmadetails/{case}'; // juniper
}
if ( u === 'Vendor known error code' ) {
urlstr[ 4] = 'https://bst.cloudapps.cisco.com/bugsearch/bug/{case}'; // cisco
}
var cur_url = unsafeWindow.g_form.getValue('u_ext_ref_no.u_url');
if (opt) {
console.log('#=#=#=# u_ext_ref_no.u_url = ' + cur_url.length + ' [' + urlstr[opt] + '] ' + urlstr[9] );
if ( urlstr[opt].length > 1 && ( cur_url.length == 7 || cur_url.length == 0 ) ) {
if ( urlstr[opt].indexOf('{case}') > 0 ) { // {case} presence means we should replace it with case reference number Cref
var Cref = unsafeWindow.g_form.getValue('u_ext_ref_no.u_reference_number').trim() ;
if ( opt == 11 ) { Cref = Cref.replace('TK-EU-',''); }
unsafeWindow.g_form.setValue('u_ext_ref_no.u_url', urlstr[opt].replace('{case}',Cref) );
} else {
unsafeWindow.g_form.setValue('u_ext_ref_no.u_url', urlstr[opt] );
}
console.log('#=#=#=# u_ext_ref_no.u_url set to =' + unsafeWindow.g_form.getValue('u_ext_ref_no.u_url') );
}
}
}
});
// ==============================================================================================================================================================
}
// ==============================================================================================================================================================
// = Normal Use Default_Mail_client =
// = =
if ( script === '/u_request.do' || script === '/incident.do' || script === '/change_request.do' || script === '/problem.do' || script === '/u_rim_event.do' ) {
// ==============================================================================================================================================================
timer1 = new Date();
GM_addStyle(' body { color:#000 !important; line-height: 16px !important; font-size:12px !important; }');
GM_addStyle(' html { color:#000 !important; line-height: 16px !important; }');
GM_addStyle(' .compacting { height:16px !important; min-height: 14px !important; }');
GM_addStyle(' .input-group-btn { height:10px !important; padding:0px !important; display: block !important; }');
// icon ref-button icon-tree btn btn-default btn-ref
GM_addStyle(' .btn { padding:0px !important;}');
GM_addStyle(' .btn-default { padding:0px !important; line-height: 12px !important; }'); //height:12px !important; padding:0px !important;
GM_addStyle(' .btn-ref { padding:0px !important; font-weight:normal !important; min-height:10px !important; height:14px !important; line-height:10px !important; width:14px !important; }'); // border: 1px solid blue;
GM_addStyle(' .compact { padding:0px !important; height:16px !important; width:16px !important; }');
GM_addStyle(' .col-lg-3 { padding:0px; }'); // label
GM_addStyle(' .col-lg-4 { width:130px !important; padding:0px 2px 0px 2px; }'); // label width:130px !important;
GM_addStyle(' .col-lg-5 { width:280px !important; }'); // field
GM_addStyle(' .form-field-addons { width:180px !important; }'); // icons behind
//GM_addStyle(' .col-lg-2 { width:250px !important; }');
GM_addStyle(' .btn-icon { font-size:12px !important; line-height:10px !important; padding:0px !important; height:14px !important; }');
GM_addStyle(' .list_popup { font-size:12px !important; line-height:10px !important; padding:0px !important; }');
GM_addStyle(' .input-group-checkbox { font-size:12px !important; line-height:10px !important; padding:0px !important; height:10px !important; min-height:10px !important; font-weight:100 !important; }');
GM_addStyle(' .control-label { font-size:12px !important; padding-top:0px !important; padding-bottom:0px !important; line-height:10px !important; }');
GM_addStyle(' .checkbox { font-size:12px !important; line-height:10px !important; padding:0px !important; height:10px !important; min-height:10px !important; font-weight:100 !important; }');
GM_addStyle(' .checkbox-label { font-weight:100 !important;height:16px !important; }');
// GM_addStyle(' .checkbox { font-size:10px !important; line-height:10px !important; padding:0px !important; height:10px !important; min-height:10px !important; font-weight:100 !important; }');
// GM_addStyle(' .checkbox-label { font-weight:100 !important; }');
GM_addStyle(' .required-marker { max-width:10px !important; width:10px !important; font-size:6px !important; font-weight:50 !important; padding:0px !important; color:red !important; }');
GM_addStyle(' .row { min-height:10px !important; }');
GM_addStyle(' .form-field { min-height:10px !important; }');
GM_addStyle(' .form-group { padding:0px !important; }');
GM_addStyle(' .input-group-addon { padding:0px 2px 0px 2px; }');
GM_addStyle(' .form-group { margin-bottom:4px; }');
GM_addStyle(' input.form-control { height:16px !important; min-height: 14px !important; }');
GM_addStyle(' select.form-control { height:16px !important; min-height: 14px !important; width:250px !important;}');
GM_addStyle(' div.input-group { height:16px !important; padding:0px !important; width:250px !important; }');
GM_addStyle(' td, input, select { padding-top:0px !important; padding-bottom:0px !important;line-height:13px !important; }');
GM_addStyle(' .vt { padding:0px 4px 0px 4px !important; }');
GM_addStyle(' .navbar { padding:0px 4px 0px 4px !important; }');
//GM_addStyle(' .btn-icon { font-size:10px !important; line-height:10px !important; padding:0px !important; height:13px !important; }');
//GM_addStyle(' .form-control { height:20px !important; }');
// GM_addStyle(' a.input-group { height:16px !important; }');
// GM_addStyle(' a.input-group-btn { height:16px !important; }');
// GM_addStyle(' a.btn-default { height:16px !important; }');
// GM_addStyle(' a.btn { height:16px !important; padding:0px !important; }');
// GM_addStyle(' html.compact a { height:16px !important; }');
// GM_addStyle(' a.height15 { height:15px !important; }');
// html.compact[data-doctype="true"] .input-group .input-group-btn .btn
//GM_addStyle(' a.btn { height:12px !important; padding:0px !important; }');
//GM_addStyle(' a.btn-default { height:12px !important; padding:0px !important; }');
// GM_addStyle(' .annotation { font-size:10px !important; padding-top:0px !important; padding-bottom:0px !important; line-height:10px !important;border-radius:5px; }'); //border: 1px solid #000;
// GM_addStyle(' html { color:#000; }');
// GM_addStyle(' table.wide { max-width:1500px !important;width:1450px !important; }');
// GM_addStyle(' div#header_attachment { max-width:1500px !important;width:1450px !important; }');
// GM_addStyle(' table.vsplit_bottom_margin { max-width:700px !important;width:700px !important; }');
// GM_addStyle(' td.vsplit { width:50% !important; }');
GM_addStyle(' .itsmplus { background-color:#efffff; padding:0px 2px 2px 4px;border-radius:5px !important; border:solid 1px #cccccc; }');
GM_addStyle(' .info_box { background-color:#lightyellow !important; border:1px solid orange !important; border-radius:5px !important; margin:0px 10px 0px 10px !important; }' );
GM_addStyle(' tr.annotation-row { background-color:transparent !important; padding:0px !important;}');
GM_addStyle(' td.annotation { background-color:transparent !important; padding:0px !important; }');
GM_addStyle(' div.annotation-wrapper { background-color:#dfffff !important; background:linear-gradient(to right, #dfffff, #dddddd , #dfffff) !important; background: -moz-linear-gradient(right, #dfffff, #dddddd , #dfffff) !important; border-radius:5px !important; border:solid 1px #cccccc;padding:0px 0px 3px 6px !important;margin:0px 10px 0px 10px;color:#000 !important; }');
GM_addStyle(' .tabs2_strip { margin-top:0px !important; }');
GM_addStyle(' .tabs2_hover { border-color:#ffa500 !important; background-color:lightyellow !important; }');
GM_addStyle(' .redalert { background-color:#FF9326;color:#FFF;border:solid 1px #444;padding:2px 0px 4px 3px;border-radius:4px;}');
GM_addStyle(' .boxsizingBorder { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width:100%;}');
// GM_addStyle(' BUTTON:hover { box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0); }');
GM_addStyle(' BUTTON:hover { box-shadow: initial; box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0); }');
GM_addStyle(' .mybut { background-color:#DFE;background-image: linear-gradient(#6D6,#282);color:#fff !important;border:solid 1px #fff;padding:3px 4px 3px 4px !important;border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px;box-shadow: 0px 1px 4px -2px #333;box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.3);}');
GM_addStyle(' .mybut_ { color:#000;border:solid 0px #000; }');
GM_addStyle(' .mybut:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0) !important; }');
//GM_addStyle(' BUTTON.mybut:hover { background-color:#6b6;background: linear-gradient(#FFFFFF, #DFE);border:solid 1px #0F0;color:#000 !important;text-decoration:none !important;box-shadow: 5px 5px 15px 0px rgba(0,255,0,1.0); }');
GM_addStyle(' .mybut:after { position:absolute;top:2px;left:2px;width:calc(100%-4px);height:50%;background:linear-gradient(rgba(0,255,0,0.9),rgba(255,255,255,0.1));}');
GM_addStyle(' .swowhilite { background-color:#dfffff; background:linear-gradient(to right, #dfffff, #dddddd , #dfffff) !important; background: -moz-linear-gradient(right, #dfffff, #dddddd , #dfffff) !important; color:#000; ;padding:10px 14px 10px 14px !important;border-radius:7px !important;}');
GM_addStyle(' .flataera { border:0;overflow:auto;background-color:#fff;resize:none;color:#000;font-family:Consolas;white-space:pre; word-wrap:normal; overflow-x:scroll; }');
GM_addStyle(' .hov { padding:3px 4px 3px 4px;overflow:scroll;border-radius:3px;font-weight:normal;font-size:12px;line-height:12px; }');
GM_addStyle(' .hov:hover { background-color:#DFE;color:#000 !important; }');
GM_addStyle(' .previmg { max-width:100px;height:auto;}');
GM_addStyle(' .previmg:hover { max-width:none; border: solid 3px #000;}');
GM_addStyle(' .borderon { border: solid 3px #000}');
GM_addStyle(' .draghandle { cursor:move; }');
GM_addStyle(' .draghandle:hover { background-color:rgba(221,255,238, 0.4); }');
GM_addStyle(' .chgnhover:hover { background:#efffff; }');
GM_addStyle(' .normalbg { background:#DFE; border:solid 2px #DFE;border-radius:3px; }');
GM_addStyle(' .alertbg { background:#FB9; border:solid 2px #FB9;border-radius:3px; }');
GM_addStyle(' .faultbg { background:red; border:solid 2px red;border-radius:3px; }');
//GM_addStyle(' .chgnhover:hover td { background:#DFE; }');
GM_addStyle(' .phnlnk_ { border: 2px solid rgb(221,255,238);background-color:rgb(221,255,238);margin-left:auto;margin-right:auto; } ');
GM_addStyle(' .phnlnk1 { border: 2px solid rgb(221,255,238);background-color:rgb(221,255,238);margin-left:auto;margin-right:auto; } ');
GM_addStyle(' .telclr { color:#600;} ');
GM_addStyle(' .mypopup { background-color:#ccc;border:solid 1px #888;border-radius:7px;color:#000;padding:7px 7px 0px 7px; z-index:100;box-shadow: 1px 1px 6px 4px #aaa }');
GM_addStyle(' .mypopup th { background-color:#DFE;color:#000; }');
GM_addStyle(' .redlink { color:red;fontWeight:bold;' );
GM_addStyle(' a.redlink { color:red;fontWeight:bold;' );
GM_addStyle(' a.redlink:hover { background:#DFE; ' );
//GM_addStyle(' .sprite1 { background-image:url("https://dimensiondataservices.service-now.com/images/sprites/i16.pngx"); background-repeat: no-repeat; }');
GM_addStyle(' .sprite1 { background-image:url("/images/sprites/i16.pngx"); background-repeat: no-repeat; }');
GM_addStyle(' .button1 { width:16px;height:16px;display:block;background-position: -0px -0px; }');
GM_addStyle(' .button1:hover { background-color:#f00; }');
GM_addStyle(' .button2 { width:16px;height:16px;display:block;background-position: -0px -16px; }');
GM_addStyle(' .button2:hover { background-color:#f00; }');
GM_addStyle(' .close-button { width:16px;height:16px;display:block;background-position: -0px -208px; }');
GM_addStyle(' .close-button:hover { background-color:#f00; }');
GM_addStyle(' .close-button { width:16px;height:16px;display:block;background-position: -0px -208px; }');
GM_addStyle(' .close-button:hover { background-color:#f00; }');
GM_addStyle(' .globe-button { width:16px;height:16px;display:block;background-position: -0px -112px; }');
GM_addStyle(' .globe-button:hover { background-color:#DFE; }');
GM_addStyle(' .msg-button { width:16px;height:16px;display:block;background-position: -0px -128px; }');
GM_addStyle(' .msg-button:hover { background-color:#DFE; }');
GM_addStyle(' .plus-button { width:16px;height:16px;display:block;background-position: -0px -336px; }');
GM_addStyle(' .plus-button:hover { background-color:#DFE; }');
GM_addStyle(' .up-button { width:16px;height:16px;display:block;background-position: -0px -432px; }');
GM_addStyle(' .up-button:hover { background-color:#DFE; }');
GM_addStyle(' .down-button { width:16px;height:16px;display:block;background-position: -0px -448px; }');
GM_addStyle(' .down-button:hover { background-color:#DFE; }');
GM_addStyle(' .flup-button { width:12px;height:8px;display:block;background-position: -2px -196px; }');
GM_addStyle(' .flup-button:hover { background-color:#DFE; }');
GM_addStyle(' input,select { padding:0px 0px 0px 4px !important; color:#000 !important; }'); // border:1px solid #ccc !important;
GM_addStyle(' input:focus, textarea:focus { -moz-box-shadow: 0 0 5px 1px rgba(255,255,255,.5); -webkit-box-shadow: 0 0 5px 1px rgba(255,255,255,.5); box-shadow: 0 0 5px 1px rgba(255,255,255,.5); }');
GM_addStyle(' .label { padding:0px 5px 0px 5px !important; }');
// GM_addStyle(' TD.annotation { padding:4px !important; }'); // background: rgba(0, 0, 0, 0.1);
// GM_addStyle(' div.annotation-wrapper { padding:0px !important; border:0px !important; font-size:12px !important;} ');
GM_addStyle('.input-group-addon { padding:0px !important; }'); // background: rgba(0, 0, 0, 0.1);
GM_addStyle(' .cantclose { background-color:#FDD !important; } ');
GM_addStyle(' .mytab a { text-decoration:none;}');
GM_addStyle(' .sldshw { width:auto; max-height:none; margin:250px auto; } '); // attachment_dialog_list
GM_addStyle(' input.u { position:absolute; left:-9999px; display:none; } ');
//GM_addStyle(' label.tgggle { display:inline; max-width:100px;height:auto; margin:10px; position:relative; cursor:pointer; float:left; z-index:10;-webkit-transition: 0s 0.5s;-moz-transition: 0s 0.5s;-o-transition: 0s 0.5s;transition: 0s 0.5s; } ');
GM_addStyle(' label.tgggle img { display:block; max-width:300px;height:auto;-webkit-transition: 0.5s ease-in-out;-moz-transition: 0.5s ease-in-out;-o-transition: 0.5s ease-in-out;transition: 0.5s ease-in-out; } ');
//GM_addStyle(' input.u:checked + label { z-index:100;-webkit-transition: 0s;-moz-transition: 0s;-o-transition: 0s;transition: 0s; } ');
GM_addStyle(' input.u:checked + label img { display:block;z-index:10;position:fixed;top:300px;left:800px; -webkit-transform:scale(4);-moz-transform:scale(4);-o-transform:scale(4);transform:scale(4); } ');
GM_addStyle(' img.i { border:solid 1px #000; } ');
GM_addStyle(' input[type=checkbox].ch { display:none; } ');
GM_addStyle(' input[type=checkbox].ch + label { background:#999;height:17px;width:12px;display:inline-block;padding:2px 4px 0px 4px;border:solid 1px #000;border-radius:4px;} '); //text-align:center;margin-left:auto;margin-right:auto;
GM_addStyle(' input[type=checkbox].ch:checked + label { background:#DFE;color:#000 !important; } ');
GM_addStyle(' input[type=radio].ch { display:none; } ');
GM_addStyle(' input[type=radio].ch + label { background:#888;color:#fff;height:17px;width:auto;display:inline-block;padding:2px 4px 0px 4px;border:solid 1px #000;border-radius:4px;} '); //text-align:center;margin-left:auto;margin-right:auto;
GM_addStyle(' input[type=radio].ch:checked + label { background:#DFE;color:#000 !important; } ');
GM_addStyle(' SPAN.itsm { background:#00BFFF; } ');
GM_addStyle(' tr.list_b td { background-color: #FFCC99 !important; }');
GM_addStyle(' td.red_td { color: #F00 !important; }');
GM_addStyle(' a.linked { white-space:nowrap !important;}' ); // disable if you need a bigger screen
GM_addStyle(' a.tplink { padding:5px; } ');
GM_addStyle(' .faketextarea { -moz-appearance:textfield-multiline;-webkit-appearance:textarea;box-shadow:inset 0px 1px 2px #000;font:medium -moz-fixed;font:-webkit-small-control;overflow:auto;padding:2px;resize:both;width:400px;height:80px;} ');
GM_addStyle(' #label.' + script + '.number { color:#000000 !important; }');
GM_addStyle(' .dd { background-color:#DFD;color:#000;} ');
GM_addStyle(' .blc { background-color:#DDF;color:#000;} ');
GM_addStyle(' .jun { background-color:#FDD;color:#000;} ');
GM_addStyle(' .cis { background-color:#FDF;color:#000;} ');
GM_addStyle(' .emc { background-color:#DDF;color:#000;} ');
GM_addStyle(' .i14x { width:14px;height:14px; } ');
GM_addStyle(' .redtext { color:red !important; border:2px solid red !important; } '); //.css('border','solid 2px red')
//GM_addStyle('.noselect { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;-o-user-select:none; } ');
GM_addStyle('.draggable { background-color:rgba(255, 0, 0, 0.4) !important;} ');
GM_addStyle('.vt { padding:0px; }'); // !important
GM_addStyle(' .list2_cell_background { border:1px solid #000; }' );
GM_addStyle(' .myspc { display:table-cell;width:2px; }' );
GM_addStyle(' .myfld { display:table-cell;width:140px !important;border:1px solid #bbb;padding:0px;padding-left: 4px;border-radius:4px !important;margin:3px !important;white-space:nowrap;background-color:rgba(128, 128, 128, 0.2); }' );
//GM_addStyle(' td.info_box { background-color:#ffff73 !important; border:1px solid orange !important; color:red !important; }' );
GM_addStyle(' .mylbl { display:table-cell;width: 65px !important;border:1px solid #bbb;padding:0px;padding-right:4px;padding-left:4px;border-radius:4px !important;margin:3px !important;white-space:nowrap; text-align:right; }' );
GM_addStyle(' .myfldc { display:table-cell; width:80px;border:1px solid #bbb;padding:4px;background-color:#EEE; }' );
GM_addStyle(' .mylblc { display:table-cell;min-width:40px;border:1px solid #bbb;padding:4px; }' );
GM_addStyle(' .mytr { padding:0px;margin:3px;border: 0px solid #00f; }' );
GM_addStyle(' .vsplit_bottom_margin { border-spacing:0px;border-collapse:collapse; } '); // squeeze table in case header
GM_addStyle(' .srch_ib { background-color:#ffa64c !important; }');
GM_addStyle(' .srch_ib:hover { color:#fff !important; }');
// GM_addStyle('.outputmsg_div { position:absolute; bottom:0; }');
// GM_addStyle(' div#' + script + '.section_header_spacer { visibility:hidden !important; display:none !important; height:20px !important; }');
// GM_addStyle(' .outputmsg_div { visibility:hidden !important; display:none !important; }');
// GM_addStyle(' #output_messages { visibility:hidden !important; display:none !important; }');
GM_addStyle(' .JsDatePickBox {position:relative;width:212px;font-family:Arial;} ');
GM_addStyle(' .JsDatePickBox .boxLeftWall{float:left;width:7px;margin:0;padding:0;} ');
GM_addStyle(' .JsDatePickBox .boxLeftWall .leftWall{margin:0;padding:0;width:7px;background:#FF0000;} ');
GM_addStyle(' .JsDatePickBox .boxRightWall{float:left;width:7px;margin:0;padding:0;} ');
GM_addStyle(' .JsDatePickBox .boxRightWall .rightWall{margin:0;padding:0;width:7px;background:#FF0000;} ');
GM_addStyle(' .JsDatePickBox .hiddenBoxLeftWall{float:left;width:0;overflow:hidden;overflow:hidden;} ');
GM_addStyle(' .JsDatePickBox .hiddenBoxRightWall{float:left;width:0;overflow:hidden;overflow:hidden;} ');
GM_addStyle(' .JsDatePickBox .boxMain{float:left;background-color:#FF73FF;margin:0;padding:15px 0 5px 0;} ');
GM_addStyle(' .JsDatePickBox .boxMainStripped{background:#73FFFF;border:none;} ');
GM_addStyle(' .JsDatePickBox .tooltip{height:12px;line-height:11px;overflow:hidden;font-size:10px;color:#666;text-align:left;padding:0;margin:2px 0 2px 0;} ');
GM_addStyle(' .JsDatePickBox .weekDaysRow{height:12px;overflow:hidden;line-height:11px;font-size:10px;color:#666;text-align:center;padding:0;margin:2px 0 0 0;} ');
GM_addStyle(' .JsDatePickBox .weekDaysRow .weekDay{float:left;height:14px;overflow:hidden;width:24px;margin:0 5px 0 0;padding:0;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner{background:#CCCCCC;width:198px;float:left;margin:5px 0 0 0;padding:0;} ');
GM_addStyle(' .JsDatePickBox .boxMainCellsContainer{background-color:#99FF99;margin:0;padding:0;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .controlsBar{overflow:hidden;height:20px;position:relative;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .controlsBarText{overflow:hidden;height:20px;line-height:20px;color:#000;font-size:12px;text-align:center;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .monthForwardButton{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;right:22px;background:url(images/activity_filter_on.gifx) left top no-repeat;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .monthForwardButtonOver{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;right:22px;background:url(images/activity_filter_on.gifx) #FFFF99 left top no-repeat;}');
GM_addStyle(' .JsDatePickBox .boxMainInner .monthBackwardButton{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;left:22px;background:url(images/activity_filter_off.gifx) left top no-repeat;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .monthBackwardButtonOver{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;left:22px;background:url(images/activity_filter_off.gifx) #FFFF99 left top no-repeat;}');
GM_addStyle(' .JsDatePickBox .boxMainInner .yearForwardButton{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;right:0;background:url(images/activity_filter_on.gifx) left top no-repeat;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .yearForwardButtonOver{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;right:0;background:url(images/activity_filter_on.gifx) #FFFF99 left top no-repeat;}');
GM_addStyle(' .JsDatePickBox .boxMainInner .yearBackwardButton{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;left:0;background:url(images/activity_filter_off.gifx) left top no-repeat;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .yearBackwardButtonOver{overflow:hidden;cursor:pointer;width:20px;height:20px;position:absolute;top:0;left:0;background:url(images/activity_filter_off.gifx) #FFFF99 left top no-repeat;}');
GM_addStyle(' .JsDatePickBox .boxMainInner .skipDay{cursor:default;overflow:hidden;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayNormal{-khtml-user-select:none;font-size:12px;cursor:pointer;overflow:hidden;color:#4c4c4c;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayNormalToday{-khtml-user-select:none;font-size:12px;cursor:pointer;overflow:hidden;color:#f40f0f;font-weight:bold;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayDisabled{-khtml-user-select:none;cursor:default;font-size:12px;overflow:hidden;color:#999;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayOver{-khtml-user-select:none;cursor:pointer;font-size:12px;overflow:hidden;background-color:#000;font-weight:bold;color:#FFFF73;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;}');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayOverToday{-khtml-user-select:none;cursor:pointer;font-size:12px;overflow:hidden;font-weight:bold;color:#f40f0f;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayDown{-khtml-user-select:none;cursor:pointer;font-size:12px;overflow:hidden;color:#F9F9F9;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;} ');
GM_addStyle(' .JsDatePickBox .boxMainInner .dayDownToday{-khtml-user-select:none;cursor:pointer;font-size:12px;overflow:hidden;color:#f40f0f;font-weight:bold;width:24px;height:25px;float:left;margin:4px 5px 0 0;padding:0;text-align:center;line-height:25px;} ');
// GM_addStyle(' body { font-size:10px !important; line-height:10px !important; padding:0px !important; }');
// GM_addStyle(' div { font-size:10px !important; line-height:10px !important; padding:0px !important; }');
// GM_addStyle(' td, input, select { font-size:10px !important; padding-top:0px !important; padding-bottom:0px !important;line-height:10px !important; }');
GM_addStyle(' .tbclk { border:solid 2px #000;padding-left:4px;padding-right:4px;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px; } ');
GM_addStyle(' .tabs2_tab:hover { border-color:#ffc926;box-shadow: 5px 5px 10px #ffffbf } ');
//-webkit-appearance:none;outline:none;background-image:url(images/drop_down.gifx); https://dimensiondataservices.service-now.com/images/drop_down.gifx
GM_addStyle(' #mailstuff { padding-top:2px;padding-bottom:2px;border-radius:3px;opacity: .6; }');
GM_addStyle(' #mailstuff:hover { opacity: 1; }');
GM_addStyle(' select#mailtype { background-repeat:no-repeat;background-position:0px;background-color:transparent;outline:none;background-image:url(images/drop_down.gifx);color:transparent !important;width:10px;padding:0px 1px 0px 1px;margin:0px;line-height:0.8;font-size:12px;border:0px; } ');
GM_addStyle(' .mto { background-image:url(images/icons/email.gifx);background-repeat:no-repeat;background-position:1px;color:#000; }');
GM_addStyle(' #pagetm { color:#EEE; padding-top:9px;}');
GM_addStyle(' .ptmhover { color:#444 !important;}');
// GM_addStyle(' select#mailtype option[value="update"] { background-image:url(images/icons/email.gifx); } ');
// GM_addStyle(' select#mailtype option[value="intro"] { background-image:url(images/icons/email.gifx); } ');
// GM_addStyle(' select#mailtype option[value="bye"] { background-image:url(images/icons/email.gifx); } ');
// https://dimensiondataservices.service-now.com/images/nav_backward.gifx
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
timer2 = new Date();
//
// Stuff you may want to personalize
//
var oooMSG = '?subject=Out Of Office\
Dear Customer,%0A%0A&body=I\'m currently out of the office.%0A%0A\
I will not be able to read my mail until I return to the office on .%0A%0A\
Best%20regards,%0A%0A';
var BTN1_text,BTN2_text,BTN3_text;
var OPT_text = [];
var ACT_text = [];
var MailTemplName = [];
var MailTemplate = [];
// {sa} will be replaced by: short firstname lastname e.g. Wouter Cosyns becomes woco
// {dt} will be replaced by: date in format dayofweek day-month-year e.g. Mon 06-Oct-2014
// {tm} will be replaced by: time in 24:00 format e.g. 07:26
// (sp=) will be replaced by: ==================
// {sp/} will be replaced by: //////////////////
BTN1_text = 'DD {sa} update to customer\n{sp=}\n';
BTN2_text = 'DD {sa} update to vendor\n{sp=}\n';
BTN3_text = 'DD {sa} update to SDM\n{sp=}\n';
OPT_text[ 1] = ' Called Cust ';
OPT_text[ 2] = ' Update to Cust ';
OPT_text[ 3] = ' Called Vendor ';
OPT_text[ 4] = ' Update to Vendor ';
OPT_text[ 5] = ' Called SDM ';
OPT_text[ 6] = ' Update to SDM ';
OPT_text[ 7] = ' Called AM ';
OPT_text[ 8] = ' Update to AM ';
OPT_text[ 9] = ' Called CM ';
OPT_text[10] = ' Update to CM ';
OPT_text[11] = ' Update from Cust ';
OPT_text[12] = ' Option 2 ';
OPT_text[13] = ' Option 3 ';
OPT_text[14] = ' Option 4 ';
OPT_text[15] = ' Option 5 ';
OPT_text[16] = ' Option 6 ';
OPT_text[17] = ' Option 7 ';
OPT_text[18] = ' Option 8 ';
OPT_text[19] = ' Option 9 ';
OPT_text[20] = ' Option 10 ';
OPT_text[21] = ' Update from Vendor ';
OPT_text[22] = ' Option 2 ';
OPT_text[23] = ' Option 3 ';
OPT_text[24] = ' Option 4 ';
OPT_text[25] = ' Option 5 ';
OPT_text[26] = ' Option 6 ';
OPT_text[27] = ' Option 7 ';
OPT_text[28] = ' Option 8 ';
OPT_text[29] = ' Option 9 ';
OPT_text[30] = ' Option 10 ';
OPT_text[31] = ' Hello ';
OPT_text[32] = ' ByeBye ';
OPT_text[33] = ' Option 3 ';
OPT_text[34] = ' Option 4 ';
OPT_text[35] = ' Option 5 ';
OPT_text[36] = ' Option 6 ';
OPT_text[37] = ' Option 7 ';
OPT_text[38] = ' Option 8 ';
OPT_text[39] = ' Option 9 ';
OPT_text[40] = ' Option 10 ';
ACT_text[ 1] = 'DD {sa} Called to Customer\n{sp=}\n';
ACT_text[ 2] = 'DD {sa} Update to Customer\n{sp=}\n';
ACT_text[ 3] = 'DD {sa} Called to Vendor\n{sp=}\n';
ACT_text[ 4] = 'DD {sa} Update to Vendor\n{sp=}\n';
ACT_text[ 5] = 'DD {sa} Called to SDM\n{sp=}\n';
ACT_text[ 6] = 'DD {sa} Update to SDM\n{sp=}\n';
ACT_text[ 7] = 'DD {sa} Called to Account Mgr\n{sp=}\n';
ACT_text[ 8] = 'DD {sa} Update to Account Mgr\n{sp=}\n';
ACT_text[ 9] = 'DD {sa} Called to Contract Mgmt\n{sp=}\n';
ACT_text[10] = 'DD {sa} Update to Contract Mgmt\n{sp=}\n';
ACT_text[11] = 'Update from Cust\n{sp=}\n';
ACT_text[12] = 'OPT_text[12] {dt} {sa}';
ACT_text[13] = 'OPT_text[13] {dt} {sa}';
ACT_text[14] = 'OPT_text[14] {dt} {sa}';
ACT_text[15] = 'OPT_text[15] {dt} {sa}';
ACT_text[16] = 'OPT_text[16] {dt} {sa}';
ACT_text[17] = 'OPT_text[17] {dt} {sa}';
ACT_text[18] = 'OPT_text[18] {dt} {sa}';
ACT_text[19] = 'OPT_text[19] {dt} {sa}';
ACT_text[20] = 'OPT_text[20] {dt} {sa}';
ACT_text[21] = 'Update from Vendor\n{sp=}\n';
ACT_text[22] = 'OPT_text[22] {dt} {sa}';
ACT_text[23] = 'OPT_text[23] {dt} {sa}';
ACT_text[24] = 'OPT_text[24] {dt} {sa}';
ACT_text[25] = 'OPT_text[25] {dt} {sa}';
ACT_text[26] = 'OPT_text[26] {dt} {sa}';
ACT_text[27] = 'OPT_text[27] {dt} {sa}';
ACT_text[28] = 'OPT_text[28] {dt} {sa}';
ACT_text[29] = 'OPT_text[29] {dt} {sa}';
ACT_text[30] = 'OPT_text[30] {dt} {sa}';
ACT_text[31] = 'Dear {fn} {ln},\n\nMy name is {mf}\n\nI have taken ownership of this case and will be assisting you in resolving this matter.\n\nBest regards,\n\n{mf}\n\n{dt} {sa}';
ACT_text[32] = 'Dear {fn} {ln},\n\nI have not heard back from you regarding this matter.\nI therefore assume you have found a solution, or the problem has gone away.\n\nIf you still require my assistance in this matter, let me know ASAP.\n\nWithout feedback from your side I will close this case at the end of business day.\n\nBest regards,\n\n{mf}\n\n{dt} {sa}';
ACT_text[33] = 'OPT_text[33] {dt} {sa}';
ACT_text[34] = 'OPT_text[34] {dt} {sa}';
ACT_text[35] = 'OPT_text[35] {dt} {sa}';
ACT_text[36] = 'OPT_text[36] {dt} {sa}';
ACT_text[37] = 'OPT_text[37] {dt} {sa}';
ACT_text[38] = 'OPT_text[38] {dt} {sa}';
ACT_text[39] = 'OPT_text[39] {dt} {sa}';
ACT_text[40] = 'OPT_text[40] {dt} {sa}';
var MyDear = 'Dear {fn} {ln},'; // How to address customer Dear customer name
var MyMGSbody = '%0D%0A%0D%0A%0D%0ABest%20regards,%0D%0A%0D%0A'; //
MyMGSbody = '\n\n\n\nBest%20regards,\n\n{mf}'; //
MailTemplName[0] = 'update';
MailTemplName[1] = 'intro';
MailTemplName[2] = 'bye';
MailTemplName[3] = 'example';
MailTemplName[4] = 'example';
MailTemplate[0] = MyDear + MyMGSbody;
MailTemplate[1] = 'Dear {fn} {ln},\n\nMy name is {mf}\n\nI have taken ownership of this case and will be assisting you in resolving this matter.\n\nBest regards,\n\n{mf}';
MailTemplate[2] = 'Dear {fn} {ln},\n\nI have not heard back from you regarding this matter.\nI therefore assume you have found a solution, or the problem has gone away.\n\nIf you still require my assistance in this matter, let me know ASAP.\n\nWithout feedback from your side I will close this case at the end of business day.\n\nBest regards,\n\n{mf}';
MailTemplate[3] = 'Beste {fn} \n\nblabla lblabla blabla blabla blablablabla\n\nblabla blabla blablablabla blabla\n\n{swow}\n\nProduct: {product}\nSerial: {serial}\nVersion: {version}\nContract: {contract}\n\nBye\n\n{mf}\n\nCompany: {company}\nKlant Voornaam: {fn}\nKlant Achternaam: {ln}\n\nMijn Voornaam: {mf}\nMijn Achternaam: {ml}\n\n{sp=}\nShort Assignee: {sa}\nNow: {dt}';
MailTemplate[4] = 'Beste {fn} \n\nMore examples\n\nCase Status: {status}\nCase ETA: {eta}\n\n{swow}\n\nProduct: {product}\nSerial: {serial}\nVersion: {version}\nContract: {contract}\n\nBye\n\n{mf}\n\nCompany: {company}\nKlant Voornaam: {fn}\nKlant Achternaam: {ln}\n\nMijn Voornaam: {mf}\nMijn Achternaam: {ml}\n\n{sp=}\nShort Assignee: {sa}\nNow: {dt}';
var drgstate = false;
var alertsend = 0;
var mnt = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var wkd = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
var ok2close = [ 6,7,9,120,130,220,780 ];
var scriptversion = GM_info.script.version;
var instance = ( location.hostname.indexOf('dimensiondatasandbox') > -1 ) ? 'sandbox' : (location.hostname.indexOf('dimensiondataservices') > -1 ) ? 'services' : (location.hostname.indexOf('dimensiondataorion') > -1 ) ? 'orion' : '';
var bingodone = '';
var remarks = '';
script = script.replace('.do','').replace('/','');
var casenr = $('#' + script + '\\.number').attr('value');
var siteid = $('#' + script + '\\.location\\.u_site_id').val();
var ro = $('span#sys_readonly\\.' + script + '\\.u_banner').length;
var sts = '';
var problem_msg = '';
var vendor_name = '<ITSM_CIMODEL_MANUFACT>';
var rma_number = '<ITSM_EXTREF_RMA + ITSM_EXTREF_THIRDPARTY>';
var serial_number = '<ITSM_CI_SN>';
var client_ref = '<ITSM_EXTREF_CLIENTREFNUM>';
var rma_lijst = [];
var tabflash = new Array(30);
var sel_target = '';
var custfn = ''; // Customer firstname lastname as global vars
var custln = '';
var MyFirstName = '';
var MyLastName = '';
var tolist = '';
var cclist = '';
var myemail = '';
var info = ['','','',''];
var CustNM = $('#' + script + '\\.company_label').val();
var Assigneegrp = $('#sys_display\\.' + script + '\\.assignment_group').val();
var $body = $('body');
var $target = null;
var xoff=0, xoff=0;
var prbarea = '';
var prbstat = GM_getValue('prbstat'+casenr,'');
var etadt = GM_getValue(casenr + '_ETA','');
var prbdesc = GM_getValue('prbdesc'+casenr,'');
var prbimpt = GM_getValue('prbimpt'+casenr,'');
var prbactp = GM_getValue('prbactp'+casenr,'');
// if ( typeof prbactp == 'undefined') { alert('noswow');}
// if ( ! GM_getValue('prbactp'+casenr) ) { alert('noswow');}
if ( prbactp === '') {
swowfind();
prbactp = prbarea;
}
if ( etadt === '' ) {
if ( prbactp.length > 0 ) {
var n = new Date();
var i;
var mt = 0;
var TM = '';
var prbactp = '';
var lines = prbarea.split('\n');
for (i = 0; i < lines.length; i++) {
if ( lines[i].toUpperCase().indexOf('COMPLETE') < 0 ) {
console.log('# eta detect 0 []', lines[i] );
prbactp = prbactp + lines[i] + '\n';
if ( lines[i].indexOf('=> ETA ') > -1 ) {
var T = lines[i].split('=> ETA')[1].replace(/-/g,'/');
if ( T.indexOf( '/' + n.getFullYear() ) == -1 && T.indexOf( '/' + ( n.getFullYear() + 1) ) == -1) { T = T + '/' + n.getFullYear(); }
var msec = Date.parse( T );
console.log('# eta detect 1 []', msec, T ); // , n.getFullYear()
if (mt == 0) {
mt = msec;
TM = T;
} else {
if ( msec < mt ) {
mt = msec
TM = T;
}
}
}
}
}
if ( TM !== '' ) {
TM = TM.replace(/\//g,'-')
etadt = TM;
} else {
etadt = $('#' + script + '\\.u_custom_date_2').val();
}
}
}
if ( prbstat === '' ) { prbstat = $('input#' + script + '\\.u_custom_text_2').val().substr(6); }
prbactp = prbactp.replace(/\n$/g, '');
// #section\2e b8a445dda84ba1b701cec7a51b559293 > table > tbody > tr > td:nth-child(2) > h2 > span > span.section_view
var theview = $('div#' + script + '\\.form_header').find('span.section_view').length;
if (theview) {
var viewtxt = $('div#' + script + '\\.form_header').find('span.section_view').text();
// alert('You are using ' + viewtxt + ' which is not default view!!\nClick ' + script + ' - ' + casenr + viewtxt + ' to adjust.');
$('div#' + script + '\\.form_header').find('span.section_view').parent().addClass('srch_ib').css('padding','5px'); //.css('color','#000').css('background-color','orange').css('padding','5px')
}
var swow = '';
var sep = '\n====================\n';
var Z = '';
if ( script === 'u_request' ) { Z = ' REQUEST'; } else if ( script === 'incident' ) { Z = ' INCIDENT'; } else if ( script === 'problem' ) { Z = ' PROBLEM'; } else if ( script === 'u_rim_event' ) { Z = ' EVENT'; } else { Z = ' CHANGE'; }
swow = Z + ' DESCRIPTION' + sep + prbdesc;
if (prbimpt.length > 0) {
swow += '\n\n IMPACT' + sep + prbimpt;
}
console.log('# aach1');
swow += '\n\n ACTION PLAN' + sep + prbactp;
console.log('# aach2');
if ( GM_getValue('mytabs') ) {
var mytabs = JSON.parse(GM_getValue('mytabs'));
console.log('#=#= mytabs ' , mytabs['Stakeholders'] , mytabs['Escalation'], GM_getValue('mytabs'));
} else {
var mytabs = { 'Scram':1,'MOVEit':1,'Webex':1,'Secret':1,'Escalation':1,'Stakeholders':1,'Custom section':1 };
}
console.log('#=#=#=# Waiting to start ITSM use default Email client');
if (typeof unsafeWindow == "undefined") {
unsafeWindow = window;
console.log('#=#=#=# unsafeWindow is not defined');
} else {
console.log('#=#=#=# unsafeWindow is defined');
}
var dd = function(p){ return (''+p).length<2?'0'+p:''+p; };
var loggedin = $('#gsft_full_name',unsafeWindow.parent.document).text();
$('#request_manager_output',unsafeWindow.parent.document).css('display','inline');
if (!loggedin) {
if ( GM_getValue('loggedin') ) {
loggedin = GM_getValue('loggedin');
}
}
if (loggedin) {
var shortassign = loggedin.split(' ')[0].substring(0,2) + loggedin.split(' ')[1].substring(0,2);
shortassign = shortassign.toLowerCase();
}
var dt = new Date();
var rnow = wkd[dt.getDay()] + ' ' + dd(dt.getDate()) + '-' + mnt[dt.getMonth()] + '-' + dt.getFullYear();
// var rnow = wkd[dt.getDay()] + ' ' + s(dt.getDate()) + '-' + mnt[dt.getMonth()] + '-' + dt.getFullYear();
$(document).on('mousemove', function(e) {
// console.log('#=#= drag move ', $target.offset({top}) , e.pageY , yoff , $target.offset({left}) , e.pageX , xoff );
if ($target) {$target.offset( {top:e.pageY - yoff,left:e.pageX - xoff} );}
} ).on('mouseup' , function(e) {
// console.log('#=#= drag drop' );
$target = null;
$body.find(".draggable").removeClass('draggable');
$body.removeClass('noselect');
// $body.unbind('mousemove');
if (sel_target) {
var t = gtseltxt();
if (t.length > 1 ) {
$('#' + sel_target).val(t);
console.log('# selected text:' + t + ' target is: ' + sel_target);
}
}
} ).dblclick( function(e) {
if (sel_target) {
var t = gtseltxt();
if (t.length > 1 ) {
$('#' + sel_target).val(t);
console.log('# selected text:' + t + ' target is: ' + sel_target);
}
}
// var t = seltxt();
// if (t) {
// console.log('# selected text:' + t + ' target is: ' + sel_target);
// if (sel_target) {
// $('#' + sel_target).val(t);
// }
// }
});
function my_tab(tb) {
if ( mytabs[tb] > 0 ) {
return ' checked ';
} else {
return '';
}
}
function swowfind() {
var outp = ['','','',''];
var p = 3;
var Tfound = '0';
var sd = script.toUpperCase().replace('U_','') + ' DESCRIPTION';
$('#element\\.' + script + '\\.comments\\.additional > span:nth-child(1) > div:nth-child(1) > div:contains("' + sd + '"):first').each( function() {
var obj = $(this);
if ( obj.text().toUpperCase().indexOf('DESCRIPTION') > -1 && obj.text().indexOf('=======') > -1 ) {
Tfound = '1';
var idx = 0;
var spantxt = obj.html();
// console.log('#=#=#=# '+ spantxt );
var t = spantxt.split('<br>');
for ( x = 0; x < t.length; x++ ) {
if ( t[x].toUpperCase().indexOf(' DESCRIPTION') > -1 && idx < 1 ) { idx = 1 ; x++; }
if ( t[x].toUpperCase().indexOf(' IMPACT') > -1 && idx < 2 ) { idx = 2 ; x++; }
if ( t[x].toUpperCase().indexOf('ACTION PLAN') > -1 && idx < 3 ) { idx = 3 ; x++; }
console.log('#=#=#=# idx=[' + idx + '] = ' + t[x].replace(/<\/?[^>]+(>|$)/g, '').replace('>','>') );
if ( t[x].indexOf('========') == -1 && t[x] && t[x] !== ' ') {
outp[idx] = outp[idx] + '\n' + t[x].replace(/<\/?[^>]+(>|$)/g, '').replace('>','>');
}
}
}
});
prbdesc = outp[1].replace('\n','').trim();
prbimpt = outp[2].replace('\n','').trim();
prbarea = outp[3].replace('\n','').trim();
$("#prbdesc").val(prbdesc);
$("#prbimpt").val(prbimpt);
$("#prbarea").val(prbarea);
console.log('#=#=#=# outp[3] = '+ outp[3] );
}
function gtseltxt() {
var t = '';
if(unsafeWindow.getSelection){
t = unsafeWindow.getSelection().toString();
}else if(document.getSelection){
t = document.getSelection().toString();
}else if(document.selection){
t = document.selection.createRange().text;
}
return t.trim();
}
// $(document).select
timer3 = new Date();
console.log('#=#=#=# Waiting.....');
window.setTimeout(Aloop,200);
function anyonecancallme2(t){
myalert('function_at_main_level ' + t);
}
function Aloop () {
timer4 = new Date();
function chk4nwcs() {
console.log('# test 4 newcase every 10 sec.' , alertsend);
if ( GM_getValue('newcase') ) {
console.log('# newcase found' , alertsend);
if ( alertsend < 1 ) {
// tabs_test('HOPLA',2);
// insertTab('HOPLA', 2, 1);
tab_rename('HOPLA','NEW CASE ');
tab_alert('NEW CASE','on', 'changed');
alertsend = 1;
console.log('# alert send if 0=' + alertsend + '\n' + GM_getValue('newcase').replace(',','\\n'));
// $('span.tab_caption_text:contains(HOPLA)').html('NEWCASE ')
$('td.column_head > span:contains(HOPLA)').html('New ' + GM_getValue('newcase').split(',')[0] + ' Case');
$('a#hoplabut').text('Add New TP Case').closest('td').find('div.info_box').css('padding','5px').html('<pre>A new TP case is pending to be added to your SVR/ICM<br> Vendor: ' + GM_getValue('newcase').replace(/,/g,'<br> ') + '<br>Click the \'Add New TP Case\' button, to go to the external reference page!</pre>');
$('a#hoplabut').closest('p').append(' <a id=delcase class=mybut>Delete TP Case</a>')
$('a#delcase').click( function() {
GM_deleteValue('newcase');
GM_setValue('casedt', 'January 1, 1970 00:00:00' );
tab_alert('NEW CASE','off', 'changed');
tab_hide('NEW CASE');
tab_click('Comments');
});
clearInterval(chk4nwcstmr);
}
}
if ( GM_getValue('newRMA') ) {
console.log('# newcase found' , alertsend);
if ( alertsend < 1 ) {
// insertTab('HOPLA', 2, 1);
tab_rename('HOPLA','NEW RMA ');
// tabs_test('HOPLA',2);
tab_alert('NEW RMA','on', 'changed');
alertsend = 1;
console.log('# alert send if 0=' + alertsend + '\n' + GM_getValue('newcase').replace(',','\\n'));
$('a#hoplabut').text('Add New TP RMA').closest('td').find('div.info_box').css('padding','5px').html('<pre>A new TP case is pending to be added to your SVR/ICM<br> Vendor: ' + GM_getValue('newcase').replace(/,/g,'<br> ') + '<br>Click the \'Add New TP Case\' button, to go to the external reference page!</pre>');
clearInterval(chk4nwcstmr);
}
}
$('#request_manager_output',unsafeWindow.parent.document).css('display','inline');
}
function getHTML(node){
if(!node || !node.tagName) return '';
if(node.outerHTML) return node.outerHTML;
// polyfill:
var wrapper = unsafeWindow.document.createElement('div');
wrapper.appendChild(node.cloneNode(true));
return wrapper.innerHTML;
}
function searchphn() {
console.log('#=# color the phones');
$('#element\\.' + script + '\\.comments\\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) ').find('span').each( function() { $(this).hlitephnnr(); });
console.log('#=# color the phones add images');
// $('.phnlnk' ).append('<img class="phncl" width=14 height=14 src="images/mobile/phone.gifx"/>');
// $('.phnlnk1').append('<img class="phncl" width=14 height=14 src="images/mobile/phone.gifx"/>');
$('.phncl').click(function() {
var info = v$(this).parent().attr("title");
phonecall(info);
});
}
function anyonecancallme(t){
myalert('function_at_Aloop_level ' + t);
}
function tab_alert(tab,onoff,clr) {
var d = 0;
// console.log('#=#=#=# Looking for tab ' , $('#tabs2_section span.tab_caption_text').length );
for ( var c = 0; c < $('#tabs2_section span.tab_caption_text').length; c++ ) {
// console.log('#=#=#=# tab ' , c );
// console.log('#=#=#=# tab ' , $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text() , c , tab , d );
if ( $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text().trim() === tab ) {
d = c;
console.log('#=#=#=# tab ', tab , d );
}
}
if ( onoff === 'on') {
tabflash[d] = setInterval( function () {
$('#tabs2_section span.tab_caption_text:eq(' + d + ')').prev().addClass(clr);
$('#tabs2_section span.tab_caption_text:eq(' + d + ')').prev().css('visibility', ( $('#tabs2_section span.tab_caption_text:eq(' + d + ')').prev().css('visibility') === 'visible' ? 'hidden' : 'visible' ) );
}, 350 );
} else {
clearInterval( tabflash[d] );
$('#tabs2_section span.tab_caption_text:eq(' + d + ')').prev().removeClass(clr);
$('#tabs2_section span.tab_caption_text:eq(' + d + ')').prev().css('visibility', 'visible');
}
}
function tab_toggle(tab) {
for ( var c = 0; c < $('#tabs2_section span.tab_caption_text').length; c++ ) {
var tabcap = $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text().trim().replace(/\s/g,' ');
tab = tab.trim().replace(/\s/g,' ');
if ( tabcap === tab ) {
console.log('#=#=#=# tab ' + c + ' ['+ tab +'] === [' + tabcap + ']' );
$('#tabs2_section span.tab_caption_text:eq(' + c + ')').parent().parent().toggle().next().toggle();
} else {
// console.log('#=#=#=# tab no match ' + c + ' ['+ tab +'] !== [' + tabcap + ']' );
}
}
if ( !c < $('#tabs2_section span.tab_caption_text').length ) {console.log('#=#=#=# tab '+ tab +' not found'); }
}
function tab_hide(tab) {
for ( var c = 0; c < $('#tabs2_section span.tab_caption_text').length; c++ ) {
var tabcap = $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text().trim().replace(/\s/g,' ').toLowerCase();
tab = tab.trim().replace(/\s/g,' ').toLowerCase();
if ( tabcap === tab ) {
console.log('#=#=#=# tab ' + c + ' ['+ tab +'] === [' + tabcap + ']' );
$('#tabs2_section span.tab_caption_text:eq(' + c + ')').parent().parent().hide().next().hide();
} else {
// console.log('#=#=#=# tab no match ' + c + ' ['+ tab +'] !== [' + tabcap + ']' );
}
}
if ( !c < $('#tabs2_section span.tab_caption_text').length ) {console.log('#=#=#=# tab '+ tab +' not found'); }
}
function tab_show(tab) {
for ( var c = 0; c < $('#tabs2_section span.tab_caption_text').length; c++ ) {
var tabcap = $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text().trim().replace(/\s/g,' ');
tab = tab.trim().replace(/\s/g,' ');
if ( tabcap === tab ) {
console.log('#=#=#=# tab ' + c + ' ['+ tab +'] === [' + tabcap + ']' );
$('#tabs2_section span.tab_caption_text:eq(' + c + ')').parent().parent().show().next().show();
}
}
if ( !c < $('#tabs2_section span.tab_caption_text').length ) {console.log('#=#=#=# tab '+ tab +' not found'); }
}
function tab_click(tab) {
for ( var c = 0; c < $('#tabs2_section span.tab_caption_text').length; c++ ) {
var tabcap = $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text().trim().replace(/\s/g,' ');
tab = tab.trim().replace(/\s/g,' ');
if ( tabcap === tab ) {
console.log('#=#=#=# tab click ' + c + ' ['+ tab +'] === [' + tabcap + '] 01' );
$('#tabs2_section span.tab_caption_text:eq(' + c + ')').parent()[0].click();
}
}
if ( !c < $('#tabs2_section span.tab_caption_text').length ) {console.log('#=#=#=# tab '+ tab +' not found'); }
for ( var c = 0; c < $('#tabs2_list span.tab_caption_text').length; c++ ) {
var tabcap = $('#tabs2_list span.tab_caption_text:eq(' + c + ')').text().trim().replace(/\s/g,' ');
tab = tab.trim().replace(/\s/g,' ');
if ( tabcap === tab ) {
console.log('#=#=#=# tab click ' + c + ' ['+ tab +'] === [' + tabcap + '] 1' );
$('#tabs2_list span.tab_caption_text:eq(' + c + ')').parent()[0].click();
}
}
if ( !c < $('#tabs2_list span.tab_caption_text').length ) {console.log('#=#=#=# tab '+ tab +' not found'); }
}
function tab_rename(tab,tabnew) {
// $('a#rmabut').text('Add New TP Case').closest('td').find('div.info_box').css('padding','5px').html('<pre>A new TP case is pending to be added to your SVR/ICM<br> Vendor: ' + GM_getValue('newcase').replace(/,/g,'<br> ') + '<br>Click the \'Add New TP Case\' button, to go to the external reference page!</pre>');
// $('span.tab_caption_text:contains(RMA)').html('NEWCASE ')
// $('td.column_head > span:contains(RMA)').html('New ' + GM_getValue('newcase').split(',')[0] + ' Case')
for ( var c = 0; c < $('#tabs2_section span.tab_caption_text').length; c++ ) {
if ( $('#tabs2_section span.tab_caption_text:eq(' + c + ')').text().trim() === tab ) {
console.log('#=#=#=# tab ', tab , c );
$('#tabs2_section span.tab_caption_text:eq(' + c + ')').text(tabnew);
$('#tabs2_section span.tab_caption_text:eq(' + c + ')').parent().parent().show().next().show();
}
}
}
function hideattachements2() {
if (hidelist.length == 0) { hidelist = [];}
console.log("#=#hidelist add " + typeof hidelist );
var t = document.getElementById("deleted_sys_ids").value;
var p = t.split(";");
t = t.replace(/;/g,"\n");
// myalert("#=#hideattachements t=\n" + t + "\np.len=" + p.length );
for (i = 0; i < p.length ; i++) {
if ( hidelist.indexOf(p[i]) == -1 ) {
console.log("#=#hidelist add " + i + " " + p[i] );
hidelist.push(p[i]);
if ( $('#sys_id_' + p[i]).length > 0 ) { $('input#sys_id_' + p[i]).parent().parent().hide(); }
} else {
// hidelist.splice(hidelist.indexOf(p[i]),1);
}
}
GM_setValue('hidelist'+casenr,hidelist.join(','));
$('#selall').scrollIntoView( { block: "end", behavior: "smooth"} );
return false;
}
// function delattachment(id) { \
// var t = document.getElementById("deleted_sys_ids").value.split(";"); \
// if ( t.indexOf(id) == -1 ) { t.push(id); } else { t.splice(t.indexOf(id),1); } \
// document.getElementById("deleted_sys_ids").value = t.join(";"); \
// console.log("#=delattachment# " + id + " " + t.join(";") ); \
// } \
// <div class="slideshow">
// <input type="checkbox" id="image1" /><label for="image1" class="toggle"><img src="../gall/pic_40h.jpg" alt="" /></label>
// <input type="checkbox" id="image2" /><label for="image2" class="toggle"><img src="../gall/pic_33h.jpg" alt="" /></label>
// <input type="checkbox" id="image3" /><label for="image3" class="toggle"><img src="../gall/pic_18h.jpg" alt="" /></label>
// </div>
function bingo() {
if ( bingodone === '' ) {
var att_total = $('a#header_attachment_list_label').find('span').text(); // #attachmentNumber_f37d3f7b6f3eaa0009d151dc5d3ee4b3
// $('#body_attachment > rendered_body:nth-child(1) > table:nth-child(5) > tbody:nth-child(1) > tr:nth-child(4) > td:nth-child(1)').css('min-height','600px');
console.log('#=#bingo 2 ', $('table#window\\.attachment.drag_section_picker').length );
$('.drag_section_movearea').addClass('draghandle');
$('div#attachment').css('width','auto').css('max-height','none').css('padding','0px').css('margin','0px').css('background-color','transparent').addClass('mypopup'); //.css('left','1px').css('top','1px')
$('div#current_attachments').addClass('sldshw').css('display','inline').css('width','auto').css('min-height','500px').css('max-height','none').find('div').css('height','100%');
$('table#window\\.attachment.drag_section_picker').css('border-radius','7px').css('min-width','800px').css('width','100%').css('max-height','none').css('border','solid 1px #0f0'); //.css('background-color','#888');
$('div#attachment_dialog_list').css('max-height','none').css('min-height','500px');
$('#attachment_table_body').parent().css('border','solid 0px #bbf'); //.css('background-color','#888');
$('span#body_attachment > rendered_body:nth-child(1) > table:nth-child(5) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(2)').append('<span><p> <input type=checkbox id=selall /> Select/Togle all attachments <input type=checkbox id=selallimg /> Select/Togle all image attachments</span> Hidden attachements: <span class="itsmplus"><span id=hidelistrm title="Click to unhide all" >' + (hidelist.length - 1) + '</span> </span> of ' + att_total + ' <span style="float:right;"><input id="hideButton2" type="submit" value="Hide "></input> <input id="removeButton2" type="submit" value=" Remove "></input></span>');
// $('span#body_attachment').find('div.caption').addClass('info_box');#body_attachment > rendered_body:nth-child(1) > table:nth-child(5) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1)
var i = 1;
while ( $('tbody#attachment_table_body > tr:nth-child(' + i + ') > td:nth-child(1) > input:nth-child(1) ').length > 0 ) {
var obj = $('tbody#attachment_table_body > tr:nth-child(' + i + ') > td:nth-child(1) > input:nth-child(1) ').next().next();
var tit = obj.attr('title');
var href = obj.attr('href').split('=')[1];
if ( hidelist.indexOf(href) == -1 ) {
if ( typeof obj.text() !== 'undefined' ) { var q = obj.html().split('_')[1].split('.')[0]; }
console.log('#=#bingo loop ', tit, href, q );
if (q == 'image') {
$('tbody#attachment_table_body > tr:nth-child(' + i + ')').addClass('chgnhover').find('td').removeAttr('width').before('<td id="ff1' + i + '" width=40></td><td id="ff2' + i + '" width=40></td>').after('<td align="left"> <input class="u" type="checkbox" id="image' + i + '" /> <label for="image' + i + '" class="tgggle"><img class="i" src="/sys_attachment.do?sys_id=' + href + '"></img></label></td><td> </td>'); //.attr('width','500px') .css('width','200px') .attr('colspan','1')
} else {
$('tbody#attachment_table_body > tr:nth-child(' + i + ')').addClass('chgnhover').find('td').removeAttr('width').before('<td id="ff1' + i + '" width=40></td><td id="ff2' + i + '" width=40></td>').after('<td align="left"> <a href="/sys_attachment.do?sys_id=' + href + '"><img src="' + obj.find('img').attr('src') + '"></img></a></td><td> </td>');
}
$('tbody#attachment_table_body > tr:nth-child(' + i + ') > td:nth-child(3) > input:nth-child(1)').clone(true, true).appendTo('td#ff1' + i).attr('title','Select attachment');
$('tbody#attachment_table_body > tr:nth-child(' + i + ') > td:nth-child(3) > input:nth-child(1)').remove();
$('td#ff1' + i).click( function(event) {
console.log('#=#=# clicked ' , hop(event.target) );
if (event.target.tagName !== 'INPUT' ) { $(this).find('input')[0].click(); }
event.stopPropagation ? event.stopPropagation() : (event.cancelBubble=true);
});
var ttlle = $('tbody#attachment_table_body > tr:nth-child(' + i + ') > td:nth-child(3) > a:nth-child(2)').attr('title').replace('Attached by ','').replace('@dimensiondata.com','').replace('@eu.didata.com','').replace('.',' ') + ' ';
$('td#ff1' + i).attr('title','Select attachment').attr('align','center');
$('td#ff2' + i).attr('title','Attached by').attr('align','right').html(ttlle);
} else {
$('tbody#attachment_table_body > tr:nth-child(' + i + ')').css('display','none').find('td').attr('style','').attr('colspan','1');
}
i++;
}
$('#removeButton').before('<input id="hideButton" type="submit" value="Hide "></input> ').removeClass('button').removeAttr('style').removeAttr('width').addClass('mybut'); // </script> <span style="display:inline; float:right; right:100px;text-align:right;"></span>
$('#attachButton').addClass('mybut');
$('#hidelistrm').css('cursor','pointer').click( function() {
hidelist = [];
document.getElementById("deleted_sys_ids").value = '';
GM_deleteValue('hidelist'+casenr);
});
console.log('#=#=#=# Assigneegrp ', Assigneegrp );
if ( Assigneegrp.indexOf('EU.BE.RSO.SD') < 0 ) {
$('#removeButton').attr('title','You can only remove your own attachments, you can hide all');
$('#removeButton2').attr('title','You can only remove your own attachments, you can hide all');
}
$('#hideButton' ).addClass('mybut').click(hideattachements2); //
$('#hideButton2' ).addClass('mybut').click(hideattachements2); //
$('#removeButton2').removeClass('button').addClass('mybut').click(function() { $('#removeButton')[0].click() });
$('#attachmentTable').css('width','400px');
$('#selall').click( function() {
var checkBoxes = $('input[id^="sys_id_"]');
checkBoxes.prop("checked", !checkBoxes.prop("checked"));
// $('input[id^="sys_id_"]').each( function(){
checkBoxes.each( function(){
delattachment( $(this).attr('id').replace('sys_id_','') );
// console.log('#=#= ' , $(this).attr('id') );
});
});
// tr.chgnhover:nth-child(2) > td:nth-child(3) > a:nth-child(2) > img:nth-child(1)
$('#selallimg').click( function() {
$('tr.chgnhover').each( function(){
console.log('# ', $(this).find('td:nth-child(3) > a:nth-child(2) > img:nth-child(1)').attr('src') );
t = $(this).find('td:nth-child(3) > a:nth-child(2) > img:nth-child(1)').attr('src');
if ( t.indexOf('_imag') > -1 ) {
$(this).find('td:nth-child(1) > input:nth-child(1)').prop("checked", !$(this).find('td:nth-child(1) > input:nth-child(1)').prop("checked") );
delattachment( $(this).find('td:nth-child(1) > input:nth-child(1)').attr('id').replace('sys_id_','') );
}
});
});
// $('tr.chgnhover > td:nth-child(1)').click(function() { this.find('td > input') }); // toggle checkbox
bingodone = 'done';
}
$('#attachmentTable > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > input:nth-child(1)').parent().append('<a onclick="addRowToTable()" title="Add Another Attachment"><img src="images/and.pngx"></img></a>');
$('#attachmentTable > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > input:nth-child(1)').remove();
// $('#attachFile').addClass('mybut');
}
// function hideattachements() { \ 21f3f7d30f7365003207cfbce1050eb5
// var t = document.getElementById("deleted_sys_ids").value; \ a9f3f7d30f7365003207cfbce1050eb4
// var p = t.split(";"); \ 25f3f7d30f7365003207cfbce1050eb4
// alert("#=#hideattachements ", t , p.length ); \
// return false; \
// }
// function hideattachements() {
// var t = $('#deleted_sys_ids').value.split(';');
// console.log('#=#hideattachements ', t.length );
// return false;
// }
// function delattachment(id) { \
// var t = document.getElementById("deleted_sys_ids").value.split(";"); \
// if ( t.indexOf(id) == -1 ) { t.push(id); } else { t.splice(t.indexOf(id),1); } \
// document.getElementById("deleted_sys_ids").value = t.join(";"); \
// console.log("#=delattachment# " + id + " " + t.join(";") ); \
// } \
function delattachment(id) {
// console.log("#=delattachment# " + id );
var t = document.getElementById("deleted_sys_ids").value.split(";");
if ( t.indexOf(id) == -1 ) { t.push(id); } else { t.splice(t.indexOf(id),1); }
document.getElementById("deleted_sys_ids").value = t.join(";");
// console.log("#=delattachment# " + id + " " + t.join(";") );
}
function attachments() {
if ($("#attachmantlist").length > 0) {
$("#attachmantlist").css('top','100px').css('left','100px').fadeIn(500);
}
else {
var imgtype = ['jpg','png','gif','bmp' ];
var img ;
var entries = $('ul#header_attachment_list').find('li.attachment_list_items').length;
var tbl ='';
for (i = 1; i <= entries ; i++) {
var obj = $('ul#header_attachment_list > li.attachment_list_items:nth-child(' + (i + 2) + ') > span:nth-child(1) > a:nth-child(1) ');
tbl += '<tr><td> ';
if ( typeof obj.find('img').attr('src') !== 'undefined' ) {
tbl += '<img src="' + obj.find('img').attr('src') + '" class="16x16"></img>';
} else { tbl += '.'; }
if ( typeof obj.attr('title') !== 'undefined' ) {
tbl += obj.attr('title').split('on ')[1] + ' ' ;
} else { tbl += '.'; }
tbl += '</td><td>';
if ( typeof obj.next().text() !== 'undefined' ) {
var t = obj.next().text();
img = '';
p = t.split('.');
img = p[p.length - 1];
} else { t= '.'; }
if ( typeof obj.attr('href') !== 'undefined' ) {
href = obj.attr('href').split('=')[1];
tbl += '<input type="checkbox" class="attachdel" id="sys_id_' + href + '" name="sys_id_' + href + '"> ' + t + '</td><td>';
if ( imgtype.indexOf( img ) > -1 )
{
tbl += '<a href="/sys_attachment.do?sys_id=' + href + '"><img src="/sys_attachment.do?sys_id=' + href + '" style="width:50px;height:auto;"></img></a>';
} else {
tbl += '<a href="/sys_attachment.do?sys_id=' + href + '"><img src="' + obj.find('img').attr('src') + '"></img></a>' ;
}
} else { tbl += '</td><td>.'; }
tbl += ' </td></tr>';
}
$("body").append('<div id="attachmantlist" style="top:100px;left:100px;background-color:#ccc;border: solid 3px #ccc;border-radius:7px;" > \
<form target="upload_target" onsubmit="return unsafeWindow.startRemoveAttachments()" method="post" action="sys_attachment.do?DELETE" > \
<table id="hop" border=0 width="100%" style="background-color:#ccc;"> \
<tr><td class="drghdl1" colspan="3" align="right" class="draghandle"><a "><img src="images/help.gifx" style="float:right;"/></a></td></tr> \
<tr><td> Date </td><td> Name </td><td> Content </td></tr> \
' + tbl + ' \
<tr><td colspan=3><a id="closeatt" value="Close">Close</a>\
<input id="deleted_sys_ids" type="hidden" value="" name="deleted_sys_ids"></input> \
<input id="removeButton" type="submit" value="Remove" title="Remove"></input>\
<input name="sysparm_nostack" type="hidden" value="yes"></input>\
<input id="sysparm_this_url" type="hidden" value="" name="sysparm_this_url"></input> \
</td></tr> \
</table></form> \
</div><script>\
</script>\
');
$("#attachmantlist").css('position','absolute').css('visibility','visible').udraggable({ handle: '.drghdl1' });
$("#closeatt").addClass('mybut').click(closeatt);
$("#removeButton").addClass('mybut');
$('.attachdel').click(delattachment(this.id));
}
}
function closeatt() {
$("#attachmantlist").css('top','100px').css('left','100px').fadeOut(500);
$("#attachmantlist").remove();
}
function findcol (id, str) {
id = id.replace(/\./g,'\\.');
// var th_tit = $('#' + id +' > thead:nth-child(1) > tr:nth-child(1) > th:nth-child(' + row + ')').attr('glide_field');
var bg = 2;
if ( $('#' + id +' > thead:nth-child(1) > tr:nth-child(1) > th:nth-child(' + bg + ')').attr('class').indexOf('list-decoration-table') > -1 ) { bg++;}
var limit = $('#' + id +' > thead:nth-child(1) > tr:nth-child(1) > th').length;
// console.log('#=#=#=# findcol columns ', limit , bg);
for (row=bg; row <= limit;row++) {
if ( $('#' + id +' > thead:nth-child(1) > tr:nth-child(1) > th:nth-child(' + row + ')').attr('glide_field').indexOf(str) > -1 ) {
console.log('#=#=#=# findcol row ', str, row );
return row;
break;
}
}
console.log('#=#=#=# findcol row ' + str + ' not found ' );
return -1;
}
function FirstLUcase(str) { return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } // word to lcase first letter upper-case e.g. Michel
function managecclist(e){
console.log('# New managecclist called!');
var list ='';
if (typeof unsafeWindow.globalContext['requester\.contact\.details'] !== "undefined" ) {
detailsArr = unsafeWindow.globalContext['requester\.contact\.details'].split(',') || []; // Pull array from globalContext
if (detailsArr.length > 5 ) {
list = '<option>' + detailsArr[6].toString().toLowerCase() + '</option>\n'; // Get requester email
}
}
if (typeof unsafeWindow.globalContext['affected\.user\.contact\.details'] !== "undefined" ) {
detailsArr = unsafeWindow.globalContext['affected\.user\.contact\.details'].split(',') || []; // Pull array from globalContext
if (detailsArr.length > 5 ) {
if ( list.indexOf( detailsArr[6].toString().toLowerCase() ) < 0 ) { list = list + '<option>' + detailsArr[6].toString().toLowerCase() + '</option>\n'; } // Get affected user email if not the same as requester
}
}
var x, y;
if (e.pageX || e.pageY) {
x = e.pageX;
} else {
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
}
x = x - 650;
y = 35;
cclist = GM_getValue('cclist'+casenr,'').toLowerCase();
tolist = GM_getValue('tolist'+casenr,'').toLowerCase();
// element.u_request.comments.additional
var it = $('#element\\.' + script + '\\.comments\\.additional').html(); // Table with all comments
var list1, list2 = ' ';
it = it.toLowerCase().replace(/ /g,'\n').replace(/=/g,'\n').replace(/;/g,'\n').replace(/"/g,'\n').replace(/\>/g,'\n').replace(/\</g,'\n').replace(/\&/g,'\n').replace(/\(/g,'').replace(/\)/g,'');
it = it.replace(/\<br\>/g,'\n');
var lines = it.split('\n');
for ( var i = 0; i < lines.length; i++) {
if ( lines[i].indexOf('@') > 0 ) {
var t = lines[i].toLowerCase().replace(/'/g,"").replace('mailto:','').replace(']','').replace('[','').replace("cc:","").replace("subject:","").replace(/ /g,"");
if ( t.indexOf('cid:image') < 0 && t.indexOf('xmpp:') < 0 && t.indexOf('sip:') < 0 && t.indexOf('.') > 0 ) {
if ( list.indexOf(t) < 0 && t.indexOf('didata.com') < 0 && t.indexOf('dimensiondata.com') < 0 ) {
var addstyl = ' ';
if (t.indexOf('bluecoat.com') > 0 ) { addstyl = 'class="blc"'; }
if (t.indexOf('juniper.net') > 0 ) { addstyl = 'class="jun"'; }
if (t.indexOf('cisco.com') > 0 ) { addstyl = 'class="cis"'; }
if (t.indexOf('emc.com') > 0 ) { addstyl = 'class="emc"'; }
if ( list.indexOf(t) < 0 && t.indexOf('/') == -1 && t.indexOf(':') == -1 && t.indexOf('\\') == -1 && t.indexOf('#') == -1 ) {
// console.log('#=#= cc ' , list , t);
list = list + '<option' + addstyl + '>' + t + '</option>\n';
}
}
if ( list2.indexOf(t) < 0 && t.indexOf('data.com') > 0 ) {
// console.log('#=#= cc ' , list , t);
list2 = list2 + '<option class="dd">' + t + '</option>\n';
}
}
}
}
list = list + '<option disabled>--------------------</option>\n' + list2;
list2 = ' ';
lines = tolist.replace(/;/g,',').split(',');
for (i = 0; i < lines.length; i++) {
if ( lines[i].indexOf('@') > 0 ) {
list1 = list1 + '<option>' + lines[i] + '</option>';
}
}
lines = cclist.replace(/;/g,',').split(',');
for (i = 0; i < lines.length; i++) {
if ( lines[i].indexOf('@') > 0 ) {
list2 = list2 + '<option>' + lines[i] + '</option>';
}
}
if ($("#newwccwindow").length > 0) {
$("#newwccwindow").css('top', y + 'px').css('left', x + 'px').fadeIn(500);
// $('#newemail').focus();
console.log('show cc');
} else {
GM_addStyle(".bloc {display:inline-block;vertical-align:top;overflow:hidden;}");
GM_addStyle(".bloc select {height:90px;width:180px;padding:1px;margin:-0px -15px -0px -0px;}");
console.log('create cc');
$("body").append('<div id="newwccwindow" style="top:' + y + 'px;left:' + x + 'px;padding-top:0px;" class="mypopup"> \
<form><table id="hopcc" border=0 padding="0" class="drghdl1" style="background-color:transparent;" > \
<tr><td colspan="4" id="ccdrag" class="draghandle"><a style="float:right;"><span id="ccCloseDlgBtn" class="sprite1 close-button"></span></a></td></tr> \
<tr><th> Emails</th><th> </th><th> To:</th><th> CC:</th></tr>\
<tr title="Select one or more addresses and click the buttons to move them"> \
<td valign=top><label class="bloc"><select id="emails" class="box-sizingBorder" multiple="multiple" size="5">' + list + '</select></label></td> \
<td><button onclick="moveOptions(this.form.emails, this.form.tolist); return false;" class="mybut"> >> TO: </button><br><br> \
<button onclick="moveOptions(this.form.emails, this.form.cclist); return false;" class="mybut"> >> CC: </button></td> \
<td valign=top><label class="bloc"><select id="tolist" class="box-sizingBorder" multiple="multiple" size="5">' + list1 + '</select></label></td> \
<td valign=top><label class="bloc"><select id="cclist" class="box-sizingBorder" multiple="multiple" size="5">' + list2 + '</select></label></td></tr>\
<tr><td><input id="newemail" size="21" name="newemail" title="Add one or more emails separated by , or ;" value=""></input></td><td> <A id="addemail" onclick="return false;"> Add </A> </td> \
<td> <button onclick="moveOptions(this.form.tolist, this.form.emails); return false;" class="mybut"> Remove </button> </td> \
<td> <button onclick="moveOptions(this.form.cclist, this.form.emails); return false;" class="mybut"> Remove </button> </td> </tr> \
<tr><td> <A id="ccsave" > Save </A></td><td> </td> \
<td> </td> <td> </td> \
</tr></table></form> \
</div> \
<SCRIPT> \
function addOption(theSel, theText, theValue) { \
var newOpt = new Option(theText, theValue); \
var selLength = theSel.length; \
theSel.options[selLength] = newOpt; \
} \
function deleteOption(theSel, theIndex) { \
var selLength = theSel.length; \
if(selLength>0) { \
theSel.options[theIndex] = null; \
} \
} \
function moveOptions(theSelFrom, theSelTo) { \
console.log("#=#= moveo " , theSelFrom, theSelTo ); \
var selLength = theSelFrom.length; \
var selectedText = new Array(); \
var selectedValues = new Array(); \
var selectedCount = 0; \
var i; \
for(i=selLength-1; i>=0; i--) { \
if(theSelFrom.options[i].selected) { \
selectedText[selectedCount] = theSelFrom.options[i].text; \
selectedValues[selectedCount] = theSelFrom.options[i].value; \
deleteOption(theSelFrom, i); \
selectedCount++; \
} \
} \
for(i=selectedCount-1; i>=0; i--) { addOption(theSelTo, selectedText[i], selectedValues[i]); } \
} \
</SCRIPT>');
$('mybut').attr('style', $('mybut').attr('style') + 'border:1px solid #FFF !important');
$("#ccsave").click(save_cc).addClass('mybut');
$("#addemail").click(add_email).addClass('mybut');
$("#newwccwindow").css('visibility','visible').css('position','absolute'); //.udraggable({ handle: '.drghdl1' }); .css('position','absolute')
$('#ccdrag').on('mousedown', function(e) {
console.log('#=#= drag' , $(e.target).closest('div').attr('id') , $(e.target).attr('id') );
if ( $(e.target).attr('id') === 'ccCloseDlgBtn') {
console.log('# hide cc 1');
$("#newwccwindow").fadeOut(1000);
} else {
if(e.offsetX==undefined){
xoff = e.pageX-$(this).offset().left;
yoff = e.pageY-$(this).offset().top;
} else {
xoff = e.offsetX;
yoff = e.offsetY;
};
$(this).addClass('draggable');
$body.addClass('noselect');
// $target = $(e.target).parent().parent().parent().parent().parent();
$target = $(e.target).closest('div');
}
});
}
}
function ccfocus(){
// $('#newemail').focus();
}
function add_email(){
console.log('add_email');
var nm=$("#newemail").val();
nm = nm.replace(/,/g,';');
var nma = nm.split(';');
console.log('add_email ' + nm);
$.each(nma , function(index, value){
$("#emails").append($("<option>",{ value: value, text: value} ));
console.log('add_email ' + index + ':' + value);
});
$("#newemail").val('');
}
function close_cc(){
console.log('# hide cc');
$("#newwccwindow").fadeOut(1000);
}
function save_cc(){
tolist = '';
$("#tolist option").each(function() {
tolist = tolist + $(this).val() + ';';
});
console.log('#save tolist' , tolist);
GM_setValue('tolist'+casenr,tolist);
cclist = '';
$("#cclist option").each(function() {
cclist = cclist + $(this).val() + ';';
});
console.log('#save cclist' , cclist);
GM_setValue('cclist'+casenr,cclist);
console.log('#save cc0');
var recep = ''; // so we add blanks '' for the required fields
if (unsafeWindow.globalContext['requester\.contact\.details']) { // In case of no requester or affected contact we still must be able to do something
detailsArr = unsafeWindow.globalContext['requester\.contact\.details'].split(','); // Pull array from globalContext
console.log('#save cc1');
recep = detailsArr[6].toString(); // Get requester email
custfn = detailsArr[0].toString().trim();
custln = detailsArr[1].toString().trim();
}
console.log('#save cc2');
MyDear = MyDear.replace('{fn}',custfn).replace('{ln}',custln);
cclist = cclist.replace('[email protected]','').replace(/ /g,';').replace(/;;/g,';');
tolist = tolist.replace(recep,'').replace(/ /g,';').replace(/;;/g,';');
if (cclist !== '') {cclist = ';'+cclist;}
tosub = 'mailto://' + recep + ';' + tolist +'?subject=RE: ' + casenr + ' - ' + encodeURIComponent($('#' + script + '\\.short_description').attr('value') ); // Put the requester email address, [6] in array, in mailto:// and (SVR nr + short description) in subject
mcc = '&[email protected]'+ cclist;
mlt = tosub + '&body=' + MyDear + MyMGSbody + '%0A%0D' + caseref + tosub + mcc;
GM_setValue('curlist', mlt + '&FROM=' + myemail );
console.log('#save cc3');
// $('#n_email').attr('href', mlt); // Adjust the link
$("#newwccwindow").fadeOut(1000); //.udraggable( 'destroy');;
console.log('#save cc4');
return false;
}
function write_swow() {
console.log('#save swow update' );
var Y, X, W, C = ' ' ;
var prbdesc = $("#prbdesc").val();
var prbimpt = $("#prbimpt").val();
var prbarea = $("#prbarea").val();
var cnm = custfn + ' ' + custln;
prbarea = prbarea.replace('customer ', cnm + ' ').replace('cust ', cnm + ' ').replace('client ', 'client(' + cnm + ') ').replace('CST ', 'CST(' + cnm + ') ');
GM_setValue('prbdesc'+casenr,prbdesc);
GM_setValue('prbimpt'+casenr,prbimpt);
C = Z + ' DESCRIPTION' + sep + prbdesc;
if (prbimpt.length > 0) { C = C +'\n\n IMPACT' + sep + prbimpt; }
C = C + '\n\n ACTION PLAN' + sep + prbarea ;
$('#' + script + '\\.comments').val(C);
$('textarea#activity-stream-comments-textarea').val(C);
swow = C;
$("#SwoWindow").fadeOut(1000); //.udraggable( 'destroy')
var n = new Date();
var i;
var mt = 0;
var TM = '';
var prbactp = '';
var lines = prbarea.split('\n');
for (i = 0; i < lines.length; i++) {
if ( lines[i].toUpperCase().indexOf('COMPLETE') < 0 && lines[i].toUpperCase().indexOf('CANCELED') < 0 ) {
console.log(lines[i]);
prbactp = prbactp + lines[i] + '\n';
if ( lines[i].indexOf('=> ETA ') > -1 ) {
var T = lines[i].split('=> ETA ')[1].replace(/-/g,'/');
if ( T.indexOf( '/' + n.getFullYear() ) == -1 && T.indexOf( '/' + ( n.getFullYear() + 1) ) == -1) { T = T + '/' + n.getFullYear(); }
var msec = Date.parse( T );
console.log('#save swowtime', msec , T + ' 12:00:00' );
if (mt == 0) {
mt = msec;
TM = T;
} else {
if ( msec < mt ) {
mt = msec
TM = T;
}
}
}
}
}
if (TM !== '' ) {
GM_setValue(casenr + '_ETA',TM);
tdate = n.toString().substr(4,20).replace(' ','-').replace(' ','-');
p = tdate.split('-');
tdata = p[1] + '-' + p[0] + '-' + p[2].trim();
TM = TM.replace(/\//g,'-')
p = TM.split(' ');
TM = p[2].trim() + ' 12:00:00';
console.log('#save swow update to u_custom_date_1 ['+ tdata + '] ' + TM );
unsafeWindow.g_form.setValue( script + '.u_custom_date_1', tdata );
unsafeWindow.g_form.setValue( script + '.u_custom_date_2', TM );
$('#l1 > td:nth-child(7)').text(TM);
console.log('#save swow update to u_custom_date_1 ['+ n.toString().substr(4,20).replace(' ','-').replace(' ','-') + ']' );
}
var st = ($('input[name=st]:radio:checked').length > 0) ? $('input[name=st]:radio:checked').val() : '';
if ( st === 'Other' && $('#othertxt').val().length > 0) { st += ' ' + $('#othertxt').val(); }
$('input#' + script + '\\.u_custom_text_2').val(shortassign + ' - ' + st );
$('input#' + script + '\\.u_custom_text_3').val($('#ciProd').val() + ';' + $('#ciVer').val() + ';' + $('#ciSer').val() + ';' + $('#ciContr').val() );
GM_setValue('prbactp'+casenr,prbactp);
GM_setValue('prbstat'+casenr,st);
$('#l1 > td:nth-child(3)').text(st); // #l1 > td:nth-child(3)
$('#l1 > td:nth-child(11)').text($('#ciContr').val());
$('#l2 > td:nth-child(3)').text($('#ciProd').val());
$('#l2 > td:nth-child(7)').text($('#ciSer').val());
$('#l2 > td:nth-child(11)').text($('#ciVer').val());
// if 1275 Pending deferred action
console.log('# Pending deferred action ', $('#' + script + '\\.u_next_step').val());
console.log('# Pending deferred action ', $('#' + script + '\\.u_next_step_displayed').val());
if ( $('#' + script + '\\.u_next_step').val() == 1275 || $('#' + script + '\\.u_next_step_displayed').val() == 1275 ) {
console.log('# Pending deferred action ');
// $('#' + script + '\\.expected_start').text(TM);
unsafeWindow.g_form.setValue( script + '.expected_start', TM );
// $('#' + script + '\\.due_date').text(TM.replace('12:00','13:00'));
unsafeWindow.g_form.setValue( script + '.due_date', TM.replace('12:00','16:00') );
$('#ni\\.' + script + '\\.u_use_operational_timezone').prop('checked', true);
$('#' + script + '\\.u_operational_timezone').val('Europe/Paris');
}
return false;
}
function close_swow(x,y){
// $("#swow").css('border', "solid 2px springgreen");
$("#SwoWindow").fadeOut(1000); //.udraggable( 'destroy')
}
function show_swow(e){
console.log('# show_swow called!');
var x, y;
if (e.pageX || e.pageY) {
x = e.pageX;
y = e.pageY;
} else {
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
y = y - 170;
x = x - 150;
if ($("#SwoWindow").length > 0) {
$("#SwoWindow").css('top',y + 'px').css('left',x + 'px').fadeIn(500);
$('table#hop > tbody:nth-child(1)').css('top','0px').css('left','0px');
console.log('# show_swow fadein');
if ( Z === ' INCIDENT') {
console.log('# INCIDENT');
if ( $('#prbimpt').val().length < 2 ) {
$('#prbimpt').addClass('redtext').text('\n Please enter an impact!.').on('focus', function() {
$('#prbimpt').removeClass('redtext').text('');
});
}
}
}
else {
// console.log('# show_swow called! new window');
var info = ['','','',''];
var p = $('input#' + script + '\\.u_custom_text_3').val().split(';');
// console.log('# show_swow called! new window 0.0');
for (i = 0; i <4 ; i++) { info[i] = (p[i] && p[i] !== 'undefined') ? p[i]:''; }
// console.log('# show_swow called! new window 0.1' , serial_number );
if (serial_number) {
if ( serial_number.indexOf('ITSM_CI') == -1 && info[2] === '') { info[2] = serial_number; }
} else {
info[2] = '';
}
// console.log('# show_swow called! new window 0.2');
if ( $('#sys_display\\.' + script + '\\.u_product').val().length > 0 && info[0] === '' ) {
if ( $('#sys_display\\.' + script + '\\.u_product').val().indexOf('VIRT') == -1 ) {
info[0] = $('#sys_display\\.' + script + '\\.u_product').val();
}
}
if (custfn) {
var cnm = custfn + ' ' + custln;
prbactp = prbactp.replace('customer ', cnm + ' ').replace('cust ', cnm + ' ').replace('client ', 'client(' + cnm + ') ').replace('CST ', 'CST(' + cnm + ') ');
}
// console.log('# show_swow called! new window 0.3');
if (!prbdesc) { prbdesc = $('#' + script + '\\.short_description').val(); }
$("body").append('<div id="SwoWindow" class="mypopup" style="top:' + y + 'px;left:' + x + 'px;padding-top:0px;" > \
<table id="hop" class="drghdl2" border=0 padding="0" style="background-color:transparent;">\
<tr><td colspan=2 id="swowdrag" class="draghandle"><a style="float:right;"><span id="Closeswow" class="sprite1 close-button"></span></a></td></tr>\
<tr><td valign=top>' + Z + ' Description:</td><td valign=top><textarea class="boxsizingBorder" id="prbdesc" cols="82" rows="2">' + prbdesc + '</textarea></td></tr>\
<tr><td background="#fff">' + Z + ' Impact:<br><br><br><a style="float:left;"><span id="plus" class="sprite1 plus-button"></a></td><td valign=top><textarea class="boxsizingBorder" id="prbimpt" size="82" rows="2">' + prbimpt + '</textarea></td></tr>\
<tr id=pls1 style="display:none;height:25px;"><td valign=top>' + Z + ' Status:</td><td>\
<input class="ch noselect" type="radio" name="st" value="Pending Customer" id="st1"><label for="st1"> Pending Customer </label>\
<input class="ch noselect" type="radio" name="st" value="Pending Vendor" id="st2"><label for="st2"> Pending Vendor </label>\
<input class="ch noselect" type="radio" name="st" value="Pending Contracts" id="st3"><label for="st3"> Pending Contract/Adm </label>\
<input class="ch noselect" type="radio" name="st" value="Other" id="st4"><label for="st4"> Other </label> <input id="othertxt" size=10>\
</td></tr>\
<tr id=pls2 style="display:none;height:22px;"><td valign=top>' + Z + ' CI:</td>\
<td>Product: <input id="ciProd" value="' + info[0] + '" size=10 title="Product for which this case is opened, that has an issue.(or appears to have)"> Version: <input id="ciVer" value="' + info[1] + '" size=10 title="Software/Hardware version of the product.">\
Serial: <input id="ciSer" value="' + info[2] + '" size=10 title="Serial or PAK you may need to open vendor case."> Contract: <input id="ciContr" value="' + info[3] + '" size=10 title="Contract nr. you may need to open vendor case.">\
</td></tr>\
<tr id="fndtr" style="display:none;"><td>Found:<p><br><p><br><a style="float:right;"><span id="firstmsg" class="sprite1 msg-button" title="Go to first customer message."></td><td valign=top><textarea class="boxsizingBorder" id="found" size="82" rows="5" title="Some selected text from the case notes that may contain the info we are looking for"></textarea></td></tr>\
<tr><td colspan=2> <textarea class="boxsizingBorder" id="prbarea" cols="100" rows="5">' + prbactp + '</textarea></td></tr>\
<tr><td colspan=2><div>\
<A id="addswow"> Add the SWOW </A> \
<a id="b1">COMPLETED</a> \
<a id="b8">CANCELED</a> \
<a id="b2">NEW</a> \
<a id="b6">ETA today</a> \
<a id="b3">ETA+1</a> \
<a id="b4">ETA+2</a> \
<a id="b7" title="Choose date from Calendar">CAL</a> \
<a id="b5" title="Import Last SWOW entry from notes" style="float:right;margin:0px;">Find SWOW</a></div>\
</td></tr></table></form>\
</div>'); // margin-right:5px;
console.log('# INCIDENT?[' + Z + ']');
if ( Z === ' INCIDENT') {
console.log('# INCIDENT');
if ( prbimpt.length < 2 ) {
$('#prbimpt').addClass('redtext').text('\n Please enter an impact!.').on('focus', function() {
$('#prbimpt').removeClass('redtext').text('');
});
}
}
$("#SwoWindow").css('position','absolute').show(); // .css('z-Index','1000'); //.css('visibility','visible')
// var prbstat = GM_getValue('prbstat'+casenr,'');
console.log('# show_swow 1' );
if (typeof prbstat === 'undefined') { prbstat = ''; }
console.log('# show_swow called![' + prbstat + '] x=' + x + ' y=' + y + ' ' );
$("#b1" ).click(f_complete).addClass('mybut').attr('title','Complete SWOW entry.(replaces selected ETA)');
$("#b8" ).click(f_cancel ).addClass('mybut').attr('title','Cancel SWOW entry.(replaces selected ETA)');
$("#b2" ).click(f_new ).addClass('mybut').attr('title','Add new SWOW entry.');
$("#b6" ).click(f_eta0 ).addClass('mybut').attr('title','Add SWOW timestamp 2 hours ahead.');
$("#b3" ).click(f_eta1 ).addClass('mybut').attr('title','Add SWOW timestamp 1 day ahead.');
$("#b4" ).click(f_eta2 ).addClass('mybut').attr('title','Add SWOW timestamp 2 days ahead.');
$("#b5" ).click(swowfind ).addClass('mybut').attr('title','Find last SWOW entry in case notes.');
$("#addswow").click(write_swow).addClass('mybut').attr('title','add SWOW notes to case comments.');
$("#b7" ).click(function(e) {
if (e.pageX || e.pageY) {
x = e.pageX;
y = e.pageY;
} else {
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
console.log('#=#= fn show callendar', x, y );
//.css('','').css('display','inline').css('visibility','visible').css('position','absolute')
$('#caldiv').css('top', (y + 8)+ 'px').css('left', x + 'px').css('z-index','1000').show() ;
}).addClass('mybut').attr('title','Add SWOW timestamp using calendar.');;
$("#Closeswow").click(close_swow);
var swowplus = GM_getValue('swowplus', false);
console.log('# show_swow GM_getValue swowplus' , swowplus );
if (typeof swowplus === 'undefined') { swowplus = false; }
if (swowplus) { $('#pls1').show(); $('#pls2').show(); }
console.log('# show_swow 2' );
$("#plus").on('click', function(){
console.log('# show plus clicked ' );
$("#fndtr").hide();
$('#pls1').toggle();
$('#pls2').toggle();
swowplus = !swowplus;
GM_setValue('swowplus',swowplus);
console.log('# show plus click done ' );
});
$('#element\\.'+script+'\\.comments\\.additional > span:nth-child(1) > div:nth-child(1) > div:last ').attr('id','firstcumsg');
$("#firstmsg").on('click', function(){
document.getElementById("firstcumsg").scrollIntoView();
$("#SwoWindow").css({ top:'40px',left:'500px' });
});
console.log('# show_swow 3' );
$("#othertxt").on('keyup', function(){
$("input[name=st][value='Other']").prop("checked",true);
});
console.log('# show_swow 4' );
$('#swowdrag').on('mousedown', function(e) {
console.log('#=#= drag' , $(e.target).closest('div').attr('id') , $(e.target).attr('id') );
console.log('#=#= drag' , $(e.target).parent().parent().parent().parent().attr('id') );
if ( $(e.target).attr('id') === 'Closeswow') {
console.log('# hide swow 1');
$("#SwoWindow").fadeOut(1000);
} else {
if(e.offsetX==undefined){
xoff = e.pageX-$(this).offset().left;
yoff = e.pageY-$(this).offset().top;
}else{
xoff = e.offsetX;
yoff = e.offsetY;
};
}
$(this).addClass('draggable');
$body.addClass('noselect');
$target = $(e.target).parent().parent().parent().parent();
});
console.log('# show_swow 5' );
// $("#found").select(function() { getSelectedText(); });
// $(document).select(function() { getSelectedText(); });
var q = $("#firstmsg").text();
console.log('# show_swow 6' );
$("#ciProd").on('focus', function(){
sel_target = 'ciProd';
$("#found").val(serialsearch('prod'));
$("#fndtr").show();
console.log('#=#= ', sel_target );
});
$("#ciVer").on('focus', function(){
sel_target = 'ciVer';
$("#found").val(serialsearch('ver'));
$("#fndtr").show();
console.log('#=#= ', sel_target );
});
$("#ciSer").on('focus', function(){
sel_target = 'ciSer';
$("#found").val(serialsearch('ser'));
$("#fndtr").show();
console.log('#=#= ', sel_target );
});
$("#ciContr").on('focus', function(){
sel_target = 'ciContr';
$("#found").val(serialsearch('cont'));
$("#fndtr").show();
console.log('#=#= ', sel_target );
});
$("#prbarea").on('focus', function(){
$("#fndtr").fadeOut(1000);
});
// $("#prbarea").on('mousedown', function(){
// var curText = $('#prbarea').val();
// setTimeout( function() {
// var cursorPosition = $('#prbarea').prop("selectionStart");
// var numberOfLineBreaks = (curText.match(/\n/g)||[]).length;
// console.log('# cursor at:' + cursorPosition + ' in ' + curText.length + ' there are ' + numberOfLineBreaks + ' linebreaks' );
// var startstrng = curText.lastIndexOf('\n',cursorPosition );
// var end_strng = curText.indexOf('\n',cursorPosition );
// if (end_strng == -1) {end_strng = curText.length;}
// if (startstrng == -1) {startstrng = 0;}
// console.log('# the line is ' + curText.substring( startstrng, end_strng) + ' from -- to :', startstrng, end_strng);
// },500 );
// });
$("#found").on('mouseup', function(){
getSelectedText();
// $('#' + sel_target ).val(getSelectedText());
console.log('#=#= mouseup on found' );
});
console.log('# show_swow 7' );
$('input[name=st]').on('change', function(){
var st = $('input[name=st]:radio:checked').val();
GM_setValue('prbstat'+casenr,st);
});
console.log('# show_swow 8' );
if ( prbstat.indexOf('Pending Customer') > -1 ) { $('#st1').prop("checked",true); }
if ( prbstat.indexOf('Pending Vendor') > -1 ) { $('#st2').prop("checked",true); }
if ( prbstat.indexOf('Pending Contracts') > -1 ) { $('#st3').prop("checked",true); }
if ( prbstat.indexOf('Other') > -1 ) { $('#st4').prop("checked",true); }
console.log('# show_swow end' );
}
return false;
}
function test123() {
var t = getSelectedText();
console.log('#=#= ', toid , t );
$("#" + sel_target).val(t);
}
function getSelectedText() {
console.log('#=#= getSelectedText target', sel_target );
var textComponent = document.getElementById('found');
var selectedText;
if (textComponent.selectionStart !== undefined) {
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
selectedText = textComponent.value.substring(startPos, endPos);
} else if (document.selection !== undefined) {
textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
if (selectedText.length > 1 ) { $("#" + sel_target).val(selectedText); }
}
function f_toggledrag(){
if ( drgstate === true ) {
$("#SwoWindow").udraggable('destroy');
$(".drghdl2").css('cursor','auto').css('background-color','initial');
drgstate = false;
} else {
$("#SwoWindow").udraggable({ handle:'.drghdl2' });
$(".drghdl2").css('cursor','move').css('background-color','#DFE');
drgstate = true;
}
}
function f_complete(){
console.log('f_complete called');
String.prototype.replaceBetween = function(start, end, what) {
return this.substring(0, start) + what + this.substring(end);
};
var curText = $('#prbarea').val();
var cursorPosition = $('#prbarea').prop("selectionStart");
var numberOfLineBreaks = ( curText.match(/\n/g)||[] ).length;
if ( cursorPosition == 0 ) { cursorPosition = curText.length; }
console.log('# cursor at:' + cursorPosition + ' in ' + curText.length + ' there are ' + numberOfLineBreaks + ' linebreaks' );
var startpos = curText.lastIndexOf('\n',cursorPosition -1 ) + 1;
var end_pos = curText.indexOf('\n',cursorPosition );
if ( end_pos == -1) { end_pos = curText.length; }
if ( startpos == -1) { startpos = 0; }
etapos = curText.indexOf('ETA ',startpos );
console.log('# the ETA line is ' + curText.substring( etapos, end_pos) + ' from -- to :', etapos, end_pos);
var areacontent = $('#prbarea').val();
var lastLine = areacontent.substr(areacontent.lastIndexOf("\n")+1);
console.log('Lastline is :' + lastLine);
var textComponent = document.getElementById('prbarea');
var selectedText;
if (textComponent.selectionStart !== undefined) {
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
selectedText = textComponent.value.substring(startPos, endPos);
} else if (document.selection !== undefined) {
textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
console.log('Selected :' + selectedText);
if ( selectedText.length > 0 ) {
areacontent = areacontent.replace(selectedText,'COMPLETED');
} else {
if (etapos > -1) {
areacontent = areacontent.replaceBetween(etapos, end_pos, 'COMPLETED');
}
else {
areacontent += ' =======> COMPLETED';
}
}
$('#prbarea').val(areacontent);
}
function f_cancel(){
console.log('f_cancel called');
String.prototype.replaceBetween = function(start, end, what) {
return this.substring(0, start) + what + this.substring(end);
};
var curText = $('#prbarea').val();
var cursorPosition = $('#prbarea').prop("selectionStart");
var numberOfLineBreaks = ( curText.match(/\n/g)||[] ).length;
if ( cursorPosition == 0 ) { cursorPosition = curText.length; }
console.log('# cursor at:' + cursorPosition + ' in ' + curText.length + ' there are ' + numberOfLineBreaks + ' linebreaks' );
var startpos = curText.lastIndexOf('\n',cursorPosition -1 ) + 1;
var end_pos = curText.indexOf('\n',cursorPosition );
if ( end_pos == -1) { end_pos = curText.length; }
if ( startpos == -1) { startpos = 0; }
etapos = curText.indexOf('=> ETA ',startpos );
if ( etapos == -1 ) { etapos = curText.indexOf('=> COMP',startpos); }
console.log('# the ETA line is ' + curText.substring( etapos, end_pos) + ' from -- to :', etapos, end_pos);
var areacontent = $('#prbarea').val();
var lastLine = areacontent.substr(areacontent.lastIndexOf("\n")+1);
console.log('Lastline is :' + lastLine);
var textComponent = document.getElementById('prbarea');
var selectedText;
if (textComponent.selectionStart !== undefined) {
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
selectedText = textComponent.value.substring(startPos, endPos);
} else if (document.selection !== undefined) {
textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
console.log('Selected :' + selectedText);
if ( selectedText.length > 0 ) {
areacontent = areacontent.replace(selectedText,'=> CANCELED');
} else {
if (etapos > -1) {
areacontent = areacontent.replaceBetween(etapos, end_pos, '=> CANCELED');
}
else { areacontent += ' =======> CANCELED'; }
}
$('#prbarea').val(areacontent);
}
function f_new(){
var sep = '.';
var nr = 0;
var areacontent = $('#prbarea').val();
lines = areacontent.split('\n');
p = lines.length;
console.log('#=#=#=# New is called. lines: ' + p);
if ( p > 0 ) {
do {
p = p -1;
if ( lines[p].split(' ')[0].indexOf(')') > 0 ) { sep = ')'; }
nr = Number( lines[p].split(sep)[0].trim() );
if ( isNaN(nr) ) { nr = Number( lines[p].split(' ')[0] ); }
if ( isNaN(nr) ) { nr = Number( lines[p].split('/')[0].trim() ); }
if ( isNaN(nr) ) { nr = Number( lines[p].split('-')[0].trim() ); }
} while ( lines[p].indexOf('.') < 0 && lines[p].indexOf(')') < 0 && p > 0);
}
var tnr = 0;
if ( GM_getValue(casenr + '_ln') ) { tnr = GM_getValue(casenr + '_ln'); };
if ( nr < 1 || isNaN(nr) ) {
nr = ( tnr > 0 ) ? (tnr + 1) : 1;
} else {
if ( nr < tnr ) { nr = tnr; }
nr = nr + 1;
}
if (areacontent.length > 2 ) {
if ( areacontent.slice(-1) == '\n') { areacontent = areacontent.substring(0,areacontent.length - 1); }
if ( areacontent.slice(-1) == '\n') { areacontent = areacontent.substring(0,areacontent.length - 1); }
nr = '\n' + nr;
}
// GM_setValue(casenr + '_ln',nr);
GM_deleteValue(casenr + '_ln');
areacontent = areacontent + nr + sep + ' ';
$('#prbarea').val(areacontent);
// $('#prbarea').focusEnd(); // trying to give focus to the textarea field putting cursor at the end.
moveCaretToEnd('#prbarea');
$('#prbarea').focus();
return false;
}
function moveCaretToEnd(el) {
if (typeof el.selectionStart == "number") {
el.selectionStart = el.selectionEnd = el.value.length;
} else if (typeof el.createTextRange != "undefined") {
el.focus();
var range = el.createTextRange();
range.collapse(false);
range.select();
}
}
function f_eta0(d){
console.log('#=#= f_eta0 called');
add_eta(0);
}
function f_eta1(d){
console.log('#=#= f_eta1 called');
add_eta(1);
}
function f_eta2(){
console.log('#=#= f_eta2 called');
add_eta(2);
}
function add_eta(d){
String.prototype.replaceBetween = function(start, end, what) {
return this.substring(0, start) + what + this.substring(end);
};
var curText = $('#prbarea').val();
var cursorPosition = $('#prbarea').prop("selectionStart");
var numberOfLineBreaks = ( curText.match(/\n/g)||[] ).length;
if ( cursorPosition == 0 ) { cursorPosition = curText.length; }
console.log('# cursor at:' + cursorPosition + ' in ' + curText.length + ' there are ' + numberOfLineBreaks + ' linebreaks' );
var startpos = curText.lastIndexOf('\n',cursorPosition -1 ) + 1;
var end_pos = curText.indexOf('\n',cursorPosition );
if ( end_pos == -1) { end_pos = curText.length; }
if ( startpos == -1) { startpos = 0; }
etapos = curText.indexOf('ETA ',startpos );
console.log('# the ETA line is ' + curText.substring( etapos, end_pos) + ' from -- to :', etapos, end_pos);
console.log('# add_eta(' + d + ') cursor at:' + cursorPosition + ' in ' + $('#prbarea').val().length );
if (typeof d == 'undefined' || isNaN(d) ) { d = 1; }
var areacontent = $('#prbarea').val();
var textComponent = document.getElementById('prbarea');
var selectedText;
if (textComponent.selectionStart !== undefined) {
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
selectedText = textComponent.value.substring(startPos, endPos);
} else if (document.selection !== undefined) {
textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
console.log('Selected :' + selectedText);
console.log('Calc new date');
var dt = new Date();
if ( d == 0 ) { dt.setHours( dt.getHours() + 2 ); }
dt.setDate( dt.getDate() + d );
console.log('#=# day =' + dt.getDay());
if ( dt.getDay() == 6 ) { dt.setDate( dt.getDate() + 2 ); }
if ( dt.getDay() == 0 ) { dt.setDate( dt.getDate() + 2 ); }
var eta = wkd[dt.getDay()] + ' ' + dd(dt.getDate()) + '-' + mnt[dt.getMonth()] + '-' + dt.getFullYear();
var rtime = dt.getHours() + ':' + dt.getMinutes();
if ( dt.getMinutes().length == 1 ) { rtime = dt.getHours() + ':0' + dt.getMinutes(); }
if ( d == 0 ) { eta = eta + ' ' + rtime; }
console.log('# new ETA :' + eta + ' dt=' + dt );
if ( selectedText.length > 0 ) {
console.log('#=# seltxt =' + selectedText);
if ( selectedText.indexOf('ETA') > -1 ) { eta = 'ETA ' + eta; }
areacontent = areacontent.replace(selectedText,'ETA ' + eta);
console.log('#=# replacing =' + selectedText + ' by:' + eta);
} else {
if (etapos > -1) {
areacontent = areacontent.replaceBetween(etapos, end_pos, 'ETA ' + eta);
}
else {
areacontent += ' ======> ETA ' + eta;
}
}
$('#prbarea').val(areacontent);
}
function colourphnnrs() {
setTimeout( function() {
console.log('#=#= colourphnnrs');
$('#lijstframe').contents().find('a.column_head').click( colourphnnrs );
$('#lijstframe').contents().find('td').hlitephnnr();
// $('#lijstframe').contents().find('.phnlnk1').append('<img class="phncl" width=14 height=14 src="images/mobile/phone.gifx"/>');
// $('#lijstframe').contents().find("a[href^='tel:']").on("click", function() { window.top.location = $(this).prop("href"); return false;});
$('#lijstframe').contents().find('a.linked').css('white-space','nowrap');
$('#lijstframe').contents().find('.phncl').click(function() {
var info = $(this).parent().attr("title");
phonecall(info);
});
}, 1000 );
}
function show_list(e){
var x, y;
if (e.pageX || e.pageY) {
x = e.pageX;
y = e.pageY;
} else {
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
if ($("#contact_lijst").length === 0) {
$("body").append('<div id="contact_lijst">');
}
cust = $('input#sys_original\\.' + script + '\\.company').val();
cust = '/sys_user_list.do?sysparm_query=u_extension_numberISNOTEMPTY^ORmobile_phoneISNOTEMPTY^ORemailISNOTEMPTY^company%3D' + cust;
console.log('lijst voor company ' + cust);
$("#contact_lijst").html("<table border=0 width='100%' style='background-color:#6D6E71;'>\
<tr><td id='sleeplijst' align='right' class='draghandle'><a style='float:right;'><span id='Closelijst' class='sprite1 close-button'></span></a></td></tr>\
<tr><td padding='5'><iframe id='lijstframe' src='" + cust + "'></iframe></td></tr> \
</table> \
").css('top',y + 'px').css('left',x + 'px').css('height','auto').css('width','auto').css('position','absolute').show(500);
// <tr><td align='right'> xxxx <img src='images/pinned.png' /></td></tr> \
y=+1; x=+2;
$("#lijstframe").css('height','auto').css('width','auto').css('min-height','200px').css('min-width','500px').css('max-height','800px');
$("#Closelijst").click( function() { $("#contact_lijst").hide(500); } );
$('#lijstframe').on('load', function () {
$('#lijstframe').contents().find('img.list_nav').click( colourphnnrs );
$('#lijstframe').contents().find('a.column_head').click( colourphnnrs );
$('#lijstframe').contents().find('td').hlitephnnr();
$('#lijstframe').contents().find('.phncl').click(function() {
var info = $(this).parent().attr("title");
phonecall(info);
});
var tblwd = Number( $('#lijstframe').contents().find('#sys_user_table').css('width').replace('px','')) + 50 ;
var tblht = Number( $('#lijstframe').contents().find('#sys_user_table').css('height').replace('px','')) + 115 ;
var htmlht = Number( $('#lijstframe').contents().find('html').css('height').replace('px','')) + 50 ;
console.log('# ' , tblwd , tblht , htmlht);
$("#lijstframe").css('height', tblht + 'px');
$("#lijstframe").css('width', tblwd + 8 + 'px');
$("#contact_lijst").css('width', tblwd + 10 + 'px');
$("#contact_lijst").css('height', tblwd + 55 + 'px');
});
$('#sleeplijst').on('mousedown', function(e) {
if ( $(e.target).attr('id') === 'Closelijst') {
console.log('# hide swow 1');
$("#contact_lijst").fadeOut(1000);
} else {
if(e.offsetX==undefined){
xoff = e.pageX-$(this).offset().left;
yoff = e.pageY-$(this).offset().top;
}else{
xoff = e.offsetX;
yoff = e.offsetY;
}
}
$(this).addClass('draggable');
$body.addClass('noselect');
$target = $(e.target).parent().parent().parent().parent();
});
}
function closequeue(st) {
if (sts !== 'NOK') {
console.log('#=#=#=# Assigning to closure queue');
var ag = '';
acgrp = unsafeWindow.g_form.getValue('sys_display.' + script + '.u_owner_group');
if (acgrp.indexOf('BE.RSO.SD') > -1 ) { ag = 'f8f8251a0fecae44990f55d003050ef6'; } // EU.BE.RSO.SD.Action
else if (acgrp.indexOf('EU.GSC.BE.') > -1 ) { ag = '23a813c80a0a3c78013368c66335c0cc'; } // EU.GSC.BE.ServiceDesk.Action
else if (acgrp.indexOf('EU.GSC.DE.') > -1 ) { ag = '23c271bb0a0a3c7800d444935fac9aa7'; } // EU.GSC.DE.ServiceDesk.Action
else if (acgrp.indexOf('EU.GSC.FR.') > -1 ) { ag = '23d65de80a0a3c7801727c9cc28b8d72'; } // EU.GSC.FR.ServiceDesk.Action 85ab94220a0a3c07008c9c6c777b9933
else if (acgrp.indexOf('EU.GSC.NL.') > -1 ) { ag = '319f90c20a0a3c7801d44d6d7cce92c2'; } // EU.GSC.NL.ServiceDesk.Action 319da1430a0a3c7800742f5dca020e05
else if (acgrp.indexOf('EU.GSC.UK.') > -1 ) { ag = '31a922d30a0a3c7801b2f56b2fd7e3a8'; } // EU.GSC.UK.ServiceDesk.Action
else if (acgrp.indexOf('.Monitoring.') > -1 ) { ag = '31b66dfb0a0a3c780063e8ee2196d023'; } // EU.GSC.Monitoring.Action
else if (acgrp.indexOf('.ServiceDesk') < 0 ) { ag = '23a813c80a0a3c78013368c66335c0cc'; acgrp = 'EU.BE.ServiceDesk'; }
unsafeWindow.g_form.setValue(script + '.assignment_group', ag );
unsafeWindow.g_form.setValue('sys_display.' + script + '.assignment_group', acgrp + '.Closure'); // First set assignment_group and then sys_display_assignment_group makes service-now go green happy
unsafeWindow.g_form.setValue('sys_display.' + script + '.assigned_to', '');
if ( st === 'OK' ) {
unsafeWindow.gsftSubmit(document.getElementById('sysverb_update_and_stay')); // Update ticket sysverb_update_and_stay
}
if ( st === 'UPDATE' ) {
unsafeWindow.gsftSubmit(document.getElementById('sysverb_update')); // Update ticket sysverb_update
}
}
}
function check4change(event) {
console.log('##==#=# change detector ' , hop( event.target ).replace(/\n/g,' ') );
if ( event.target.nodeName === 'INPUT' && event.target.id === 'sys_display.'+ script +'.u_classification' ) {
mandatory_fields();
}
if ( event.target.nodeName === 'INPUT' && event.target.id === 'sys_display.'+ script +'.u_product' ) {
mandatory_fields();
}
// mandatory_fields(); sys_display.u_request.u_product
// CI model u_request.u_product
// Classification u_classification
//
}
function dingdong(me) {
var p = Number($('#' + script + '\\.u_next_step_displayed option:selected').val());
console.log('#=#=#=# Button becomes visible if ' + p + ' in ' + ok2close ); // 130 Set to resolved
if ( ok2close.indexOf(p) > 0 ) {
ClosingCase = true;
console.log('#=#=#=# ClosingCase = true' );
// $("#closeq").on('click', function() { closequeue(sts) });
// $("#closeq2").on('click', function() { closequeue(sts) });
$('select' ).on('change', function(event) { check4change(event); });
$('input' ).on('change keypress', function(event) { check4change(event); });
$('textarea').on('change keypress', function(event) { check4change(event); });
$('input#sys_display\\.' + script + '\\.u_task_resolution_code').blur(mandatory_fields);
$('input#sys_display\\.' + script + '\\.u_task_rootcause ').blur(mandatory_fields);
$('textarea#' + script + '\\.close_notes ').blur(mandatory_fields);
$('textarea#' + script + '\\.u_root_cause_comments ').blur(mandatory_fields);
// $("#closeq").show();
// $("#closeq2").show();
$('div#tabs2_section > h3.tab_header:nth-child(10) > span:nth-child(1) > span:nth-child(1)').attr('id','clodeti');
// if ( $('div#tabs2_section > h3.tab_header:nth-child(10) > span:nth-child(1) > span:nth-child(1)').is(':visible') ) {
console.log('#=#=#=# Closure fields missing indicator is: ' , $('span#clodeti').css('visibility') );
if ( $('span#clodeti').css('visibility') !== 'hidden' ) { // Closure Details Tab marker mandatory
$('div#tabs2_section > h3.tab_header:nth-child(10) > span:nth-child(1)')[0].click(); // click Closure Details Tab
console.log('#=#=#=# ClosingCase ', $('span#clodeti').css('visibility'));
// $('#closeq img:first-child').attr('src','/images/issues.gifx')
// $("#closeq2").hide();
observer.disconnect();
var obstarget = document.querySelector('span#clodeti');
var obsconfig = { attributes: true, childList: true, characterData: true, subtree: false };
console.log('##==#=# observer watch span#clodeti' );
observer.observe(obstarget, obsconfig);
} else {
if ( $('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(1)').css('visibility') === 'visible' ) {
// $('div#tabs2_section > h3.tab_header:nth-child(8) > span:nth-child(1)')[0].click(); // click Contract Change Tab
$('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1)')[0].click(); // click Workload Tab
// h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(2)
document.getElementById("tabs2_list").scrollIntoView();
document.getElementById("tabs2_list").scrollIntoView( { behavior: "smooth"} );
$('#godown')[0].click();
workloadTabEditing = true;
console.log('##==#=# workloadTabEditing = true ');
}
observer.disconnect();
var obstarget = document.querySelector( '#' + script + '\\.task_time_worked\\.task_table');
var obsconfig = { attributes: true, childList: true, characterData: true, subtree: true };
console.log('##==#=# observer watch #' + script + '\\.task_time_worked\\.task_table' );
// observer.observe(obstarget, obsconfig);
var t = CHKworkload();
}
mandatory_fields();
} else {
ClosingCase = false;
console.log('#=#=#=# ClosingCase = false' );
$("#closeq").hide();
$("#closeq2").hide();
$('tr#element\\.' + script + '\\.assignment_group').removeClass('cantclose');
$('td#label\\.' + script + '\\.assignment_group').removeClass('cantclose');
$('#l0').removeClass('info_box');
$('table#' + script + '\\.task_time_worked\\.task_table').find('tr.list_b').removeClass('list_b');
ShowCloseBtns('');
}
}
function mandatory_fields() {
var wl = $('#l0 > td:nth-child(3)').text().split(' ')[0];
var tit = '';
sts = 'OK';
if (wl == 0 && $('#sys_display\\.' + script + '\\.assignment_group') !== 'EU.BE.Operators' ) {
tit += '\nWorkload should not be 0';
$('#l0').addClass('info_box');
sts = 'NOK';
console.log('##==#=# mandatory_fields Workload 0 !!' );
} else {
$('#l0').removeClass('info_box');
}
var t = CHKworkload();
if (t !== '' ){
tit += '\n' + t;
sts = 'NOK';
console.log('##==#=# mandatory_fields Workload billable !!' );
} else {
document.getElementById( 'header_attachment_list_label' ).scrollIntoView();
console.log('#=#=#=# goto top' );
$('#goup')[0].click();
}
console.log('##==#=# mandatory_fields 0.0 ' + $('span#clodeti').css('visibility') + ' , ' + $('span#clodeti').is(':visible') );
// if ( ! $('span#clodeti').css('visibility') === 'hidden' ) {
if ( $('span#clodeti').css('visibility') === 'visible' ) { // closure_details.css('visibility'), closure_details.hasClass('mandatory')
tit += '\nClosure fields are not filled out!';
sts = 'NOK';
console.log('##==#=# mandatory_fields Closure fields !!' );
$('#goup')[0].click();
} else {
if (remarks !== '') {
// $('div#tabs2_section > h3.tab_header:nth-child(8) > span:nth-child(1)')[0].click(); // click Contract Change Tab
document.getElementById("tabs2_list").scrollIntoView();
console.log('#=#=#=# goto workload' );
}
observer.disconnect();
var obstarget = document.querySelector( '#' + script + '\\.task_time_worked\\.task_table');
var obsconfig = { attributes: true, childList: true, characterData: true, subtree: true };
console.log('##==#=# observer watch #' + script + '\\.task_time_worked\\.task_table' );
// observer.observe(obstarget, obsconfig);
}
// console.log('##==#=# mandatory_fields0.3', t );
// console.log('##==#=# mandatory_fields1' );
if ($('#sys_display\\.' + script + '\\.u_product').val() === '') {
$('#status\\.' + script + '\\.u_product').addClass('mandatory').removeClass('changed');
tit += '\nCI Model not filled out!';
$('#sys_display\\.' + script + '\\.u_product').addClass('cantclose');
sts = 'NOK';
console.log('##==#=# mandatory_fields CI Model !!' );
} else {
$('#sys_display\\.' + script + '\\.u_product').removeClass('cantclose');
$('#status\\.' + script + '\\.u_product').addClass('changed').removeClass('mandatory');
}
// console.log('##==#=# mandatory_fields2' );
if ($('#sys_display\\.' + script + '\\.u_classification').val() === '') {
$('#status\\.' + script + '\\.u_classification').addClass('mandatory').removeClass('changed');
tit += '\nClassification not filled out!';
$('#sys_display\\.' + script + '\\.u_classification').addClass('cantclose');
sts = 'NOK';
console.log('##==#=# mandatory_fields Classification !!' );
} else {
$('#sys_display\\.' + script + '\\.u_classification').removeClass('cantclose');
$('#status\\.' + script + '\\.u_classification').addClass('changed').removeClass('mandatory');
}
// console.log('##==#=# mandatory_fields workload billable should be empty ', t );
// console.log('##==#=# mandatory_fields closure details should be hidden ', $('span#clodeti').css('visibility') );
// console.log('##==#=# mandatory_fields classification should be > 0 ', $('#sys_display\\.' + script + '\\.u_classification').val() ); //.length()
// console.log('##==#=# mandatory_fields3' );
// if ( t === '' &&
// $('#sys_display\\.' + script + '\\.u_classification').val() !== '' &&
// $('#sys_display\\.' + script + '\\.u_product').val() !== '' &&
// $('span#clodeti').css('visibility') === 'hidden' ){
// $('#closeq img:first-child').attr('src','/images/request_completed.gifx')
// console.log('##==#=# mandatory_fields OK' );
// $('#closeq img:first-child').removeClass('cantclose').attr('title','Reassign to closure queue and SAVE.');
// $('tr#element\\.' + script + '\\.assignment_group').removeClass('cantclose');
// $('td#label\\.' + script + '\\.assignment_group').removeClass('cantclose');
// $('#myinfo_box').removeClass('info_box');
// $('#closeq2').show();
//
// observer.disconnect();
// } else {
// $('#closeq img:first-child').attr('src','/images/issues.gifx')
// sts = 'NOK';
// console.log('##==#=# mandatory_fields NOK!' );
// $('tr#element\\.' + script + '\\.assignment_group').addClass('cantclose');
// $('td#label\\.' + script + '\\.assignment_group').addClass('cantclose');
// $('#myinfo_box').addClass('info_box');
// $('#closeq img:first-child').addClass('cantclose').css('padding','0px 5px 0px 5px').attr('title', tit ); //.css('background-color', '#FBB')
// $("#closeq2").hide();
// }
// console.log('##==#=# mandatory_fields4' );
if ( Assignee !== '' && Assignee !== unsafeWindow.g_form.getValue('sys_display.' + script + '.u_resolved_by').toString() && $('#me').length == 0 ) {
console.log('#=#=#=# Resolvedby != Assignee', Assignee, unsafeWindow.g_form.getValue('sys_display.' + script + '.u_resolved_by').toString() );
$('#sys_display\\.' + script + '\\.u_resolved_by').addClass('cantclose').after(' <a><img src=images/green_back.gifx id="me" /></a>'); // .css('cursor','pointer')
$('#me').on('click', function() {
unsafeWindow.g_form.setValue(script + '.u_resolved_by', unsafeWindow.g_form.getValue(script + '.assigned_to') );
unsafeWindow.g_form.setValue('sys_display.' + script + '.u_resolved_by', Assignee);
$('#sys_display\\.' + script + '\\.u_resolved_by').css('background-color','initial');
});
}
if ( $('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(1)').css('visibility') === 'visible' ) {
sts = 'NOK';
console.log('##==#=# mandatory_fields NOK!' );
$('#godown')[0].click();
}
// $('#closeq img:first-child').attr('src','/images/issues.gifx')
// $('#closeq img:first-child').addClass('cantclose').css('padding','0px 5px 0px 5px').attr('title', tit ); //.css('background-color', '#FBB')
// $("#closeq2").hide();
// $('tr#element\\.' + script + '\\.assignment_group').addClass('cantclose');
// $('td#label\\.' + script + '\\.assignment_group').addClass('cantclose');
// } else {
// $('tr#element\\.' + script + '\\.assignment_group').removeClass('cantclose');
// $('td#label\\.' + script + '\\.assignment_group').removeClass('cantclose');
ShowCloseBtns(tit);
}
function ShowCloseBtns(tit) {
console.log('##==#=# ShowCloseBtns ' + sts + ' , ' + tit );
if (ClosingCase) {
if (sts == 'NOK') {
tit = 'You cannot reassign to closure queue because:' + tit;
$('#closeq img:first-child').attr('src','/images/issues.gifx').attr('title', tit );
$('#closeq').show();
$("#closeq2").hide();
$('tr#element\\.' + script + '\\.assignment_group').addClass('cantclose');
$('td#label\\.' + script + '\\.assignment_group').addClass('cantclose');
$("#closeq" ).on('click', function() { closequeue('NOK'); } );
} else {
$('#closeq img:first-child').attr('title','Reassign to closure queue and SAVE.').attr('src','/images/request_completed.gifx');
$('#closeq2 img:first-child').attr('title','Reassign to closure queue and UPDATE.');
$('#closeq').show();
$('#closeq2').show();
$('tr#element\\.' + script + '\\.assignment_group').removeClass('cantclose');
$('td#label\\.' + script + '\\.assignment_group').removeClass('cantclose');
$("#closeq" ).on('click', function() { closequeue('OK'); } );
$('#closeq2').on('click', function() { closequeue('UPDATE'); } );
$('table#' + script + '\\.task_time_worked\\.task_table').find('tr.list_b').removeClass('list_b');
}
} else {
$("#closeq").hide();
$("#closeq2").hide();
$('tr#element\\.' + script + '\\.assignment_group').removeClass('cantclose');
$('td#label\\.' + script + '\\.assignment_group').removeClass('cantclose');
$('table#' + script + '\\.task_time_worked\\.task_table').find('tr.list_b').removeClass('list_b');
}
}
function CHKworkload() {
// console.log('##==#=# CHKworkload' );
// $('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(1)').css('visibility','hidden');
$('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(1)').css('visibility','hidden');
var wl_rows = $('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr').length;
var wl_col = findcol( script + '.task_time_worked.task_table','task_time_worked.u_billable');
// $('#myinfo_box').removeClass('info_box');
// $('td#label\\.' + script + '\\.assignment_group').removeClass('cantclose');
// $('tr#element\\.' + script + '\\.assignment_group').removeClass('cantclose');
var pp = 1;
remarks = '';
// console.log('##==#=# === ', wl_contr, wl_rows, wl_col );
if (wl_contr === 'Uncovered base') {
workloadTabEditing = false;
// console.log('##==#=# altijd' , pp , wl_rows );
while ( pp < ( wl_rows - 1 ) ) {
var wl_bil = $('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr:nth-child(' + pp + ') > td:nth-child(' + wl_col + ') ').text();
// console.log('##==#=# loop?2' , wl_bil );
if (wl_bil === 'true') {
$('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr:nth-child(' + pp + ') > td:nth-child(' + wl_col + ')').addClass('red_td');
$('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr:nth-child(' + pp + ')').addClass('list_b');
$('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(1)').css('visibility','visible');
remarks = 'Workload should be marked as non-billable!';
} else {
$('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr:nth-child(' + pp + ') > td:nth-child(' + wl_col + ')').removeClass('red_td').parent().removeClass('list_b');
// $('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr:nth-child(' + pp + ')').removeClass('list_b');
}
// console.log('##==#=# in loop' , pp , wl_rows , wl_bil);
pp++;
}
if ( remarks !== ''){
$('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1) > span:nth-child(1)').css('visibility','visible');
// $('div#tabs2_section > h3.tab_header:nth-child(8) > span:nth-child(1)')[0].click(); // click Contract Change Tab
$('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1)')[0].click(); // click Workload Tab
// $('div#tabs2_list > h3.tab_header:nth-child(14) > span:nth-child(1)').scrollIntoView();
// document.getElementById("tabs2_list").scrollIntoView();
workloadTabEditing = true;
}
// $('#myinfo_box').html('<p class=mylbl>Total workload:</p><p class="myspc"></p><p class=myfld>' + timeworked + '</p>' ).css('display','block'); //.addClass('info_box');
$('#l0').html('<td class=mylbl>Total workload:</td><td class="myspc"></td><td class=myfld>' + timeworked + '</td><td> </td><td> </td>' ); //.addClass('info_box');
}
return remarks;
}
function dingdong2() {
var p = Number($('#' + script + '\\.u_accepted option:selected').val());
console.log('#=#=#=# Reject action if ' + p + ' = 2 '); // 2 = Rejected
if ( p == 2 ) {
var ag = '';
acgrp = unsafeWindow.g_form.getValue('sys_display.' + script + '.u_owner_group');
if (acgrp.indexOf('BE.RSO.SD') > -1 ) { ag = '6797e9920fecae44990f55d003050e59'; } // EU.BE.RSO.SD.Action
else if (acgrp.indexOf('EU.GSC.BE.') > -1 ) { ag = '239f83e30a0a3c78010d67f1fa6de9de'; } // EU.GSC.BE.ServiceDesk.Action
else if (acgrp.indexOf('EU.GSC.DE.') > -1 ) { ag = '23be2f770a0a3c78018400e8490d9fcd'; } // EU.GSC.DE.ServiceDesk.Action
else if (acgrp.indexOf('EU.GSC.FR.') > -1 ) { ag = '23d474590a0a3c7801be92458b5d8d60'; } // EU.GSC.FR.ServiceDesk.Action 85ab94220a0a3c07008c9c6c777b9933
else if (acgrp.indexOf('EU.GSC.NL.') > -1 ) { ag = '319da1430a0a3c7800742f5dca020e05'; } // EU.GSC.NL.ServiceDesk.Action 319da1430a0a3c7800742f5dca020e05
else if (acgrp.indexOf('EU.GSC.UK.') > -1 ) { ag = '31a4e1c70a0a3c7800a42dffe9461a06'; } // EU.GSC.UK.ServiceDesk.Action
else if (acgrp.indexOf('.Monitoring.') > -1 ) { ag = '31b1bde80a0a3c780074afef543b73ac'; } // EU.GSC.Monitoring.Action
else if (acgrp.indexOf('.ServiceDesk') < 0 ) { ag = '239f83e30a0a3c78010d67f1fa6de9de'; acgrp = 'EU.BE.ServiceDesk'; }
unsafeWindow.g_form.setValue(script + '.assignment_group', ag );
unsafeWindow.g_form.setValue('sys_display.' + script + '.assignment_group', acgrp + '.Action'); // First set assignment_group and then sys_display_assignment_group makes service-now go green happy
unsafeWindow.g_form.setValue('sys_display.' + script + '.assigned_to', '');
console.log('#=#=#=# Reject reason ' + $('select#' + script + '\\.u_redirect_reason').val() ); // u_request.u_redirect_reason #u_request\.u_redirect_reason
unsafeWindow.g_form.setValue(script + '.u_redirect_reason','Incorrectly assigned');
setTimeout( function() {
unsafeWindow.g_form.setValue(script + '.u_redirect_reason','Incorrectly assigned');
}, 2000);
}
}
function wim0_f( tab , txt) {
console.log('#=#=#=# wim0_f ' + tab + ' '+ txt );
dt = new Date();
rnow = wkd[dt.getDay()] + ' ' + dd(dt.getDate()) + '-' + mnt[dt.getMonth()] + '-' + dt.getFullYear();
var rtime = dt.getHours() + ':' + dt.getMinutes();
if (tab == 'comments') {
cur = $('#' + script + '\\.comments').val();
cur = $('textarea#activity-stream-comments-textarea').val();
} else if ( tab == 'notes') {
cur = $('#' + script + '\\.work_notes').val();
cur = $('textarea#activity-stream-work_notes-textarea').val();
}
t_arr = txt.split('\n');
var p = 0;
for (i = 0; i < t_arr.length; i++) {
if ( p < t_arr[i].length ) { p = t_arr[i].length; }
}
if ( cur !== '' ) { txt = cur + '\n' + txt; }
sep1 = Array(p + 2).join("=");
sep2 = Array(p + 2).join("/");
sep3 = Array(p + 2).join("_");
// {sa} will be replaced by: short firstname lastname e.g. Michel Hegeraat becomes mihe
// {dt} will be replaced by: date in format dayofweek day-month-year e.g. Mon 06-Oct-2014
// {tm} will be replaced by: time in 24:00 format e.g. 07:26
// (sp=) will be replaced by: ==================
// {sp/} will be replaced by: //////////////////
// {sp_} will be replaced by: __________________
txt = txt.replace('{dt}',rnow).replace('{sa}',shortassign).replace('{sp=}',sep1).replace('{sp/}',sep2).replace('{tm}',rtime);
txt = txt.replace('{fn}',custfn).replace('{ln}',custln).replace(/{mf}/g,MyFirstName).replace(/{ml}/g,MyLastName).replace(/{mn}/g,Assignee);
txt = txt.replace(/\\n/g,'\n>');
//.replace(/===+/g,sep1).replace(/\/\/\/+/g,sep2).replace(/___+/g,sep3)
if (tab == 'comments') {
$('#' + script + '\\.comments').val(txt);
$('textarea#activity-stream-comments-textarea').val(txt);
} else if (tab == 'notes' ) {
$('#' + script + '\\.work_notes').val(txt);
$('textarea#activity-stream-work_notes-textarea').val(txt);
}
$('#wims1').val('0');
$('#wims2').val('0');
$('#wims3').val('0');
$('#wims4').val('0');
$('#wims5').val('0');
$('#wims6').val('0');
$('#wims7').val('0');
$('#wims8').val('0');
}
function wims_f( f ,p) {
console.log('#=#=#=# wims ' + f + ' '+ p );
if ( f == 1 ) {
tab = 'comments';
} else if ( f == 2 ) {
tab = 'notes';
}
// var opt = $('#wims').val();
if ( p > 0 ) {
wim0_f( tab , ACT_text[p] );
}
}
function wim1_f() {
wim0_f(BTN1_text);
}
function wim2_f() {
wim0_f(BTN2_text);
}
function wim3_f() {
wim0_f(BTN3_text);
}
function vndrmail(e) {
e = e.replace('Mail ','');
wim0_f('comments', 'DD {sa} {dt} {tm} Mail send to ' + e + '\n{sp=}\n\n');
}
function phonecall(e) {
console.log('#=#=#=# phonecall ' + e );
// if ( e === '' ) { }
e = e.replace('Call ','');
wim0_f('comments', 'DD {sa} {dt} {tm} Call made to ' + e + '\n{sp=}\n\n');
}
function other_tab_clicked() {
console.log( '#=#=# other tab clicked');
GM_deleteValue('activetab');
$('.tabs2_section.mytab').hide();
$('.tabs2_tab.mytab').removeClass('tabs2_active');
}
function serialsearch(lookfor){
var it = $('#element\\.' + script + '\\.comments\\.additional').html(); // Table with all comments
var regex = /(<([^>]+)>)/ig
it = it.replace(/\<br\>/g,'\n').replace(regex, " ");
// it = it.toLowerCase().replace(/\<br\>/g,'\n').replace(/=/g,'\n').replace(/;/g,'\n').replace(/"/g,'\n').replace(/\>/g,'\n').replace(/\</g,'\n').replace(/\&/g,'\n').replace(/\(/g,' ').replace(/\)/g,' '); //.replace(/ /g,'\n')
var lines = it.split(/(\s+)/);
var lines = it.split('\n');
// console.log('#=#=# serialsearch ' , it);
var watch = '' ;
var t = 0 ;
while ( t < lines.length -1 ) {
if (lookfor === 'ser' ) {
if ( lines[t].toUpperCase().indexOf('S/N') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SERIAL') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SER#') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('PAK') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SR:') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SR :') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SN:') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SN :') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SR#') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SR #') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SERIALNUMBER') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SERIAL_NUMBER') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SERIENUMMER') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SERIE') > -1 ) { watch += lines[t] + '\n'; }
}
if (lookfor === 'prod' ) {
if ( lines[t].toUpperCase().indexOf('HARDWARE') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('MODEL') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('TYPE') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('PRODUCT') > -1 ) { watch += lines[t] + '\n'; }
}
if (lookfor === 'ver' ) {
if ( lines[t].toUpperCase().indexOf('VERSION') > -1 ) { watch += lines[t] + '\n'; }
if ( lines[t].toUpperCase().indexOf('SOFTWARE') > -1 ) { watch += lines[t] + '\n'; }
}
if (lookfor === 'cont' ) {
if ( lines[t].toUpperCase().indexOf('CONTRACT') > -1 ) { watch += lines[t] + '\n'; }
}
t++;
}
return watch;
}
function tabs_test(tab_cap,color) {
// $('div#tabs2_section > h3:nth-child(12)'); // #tabs2_section > h3:nth-child(12) .addClass('planning').attr('id','planning')
// console.log('#=#=#Tab 0 ' + $('div#tabs2_section > h3:nth-child(10)').length );
// console.log('#=#=#Tab 1 ' + $('div#tabs2_section > h3:nth-child(12)').length );
// console.log('#=#=#Tab 2 ' + $('#planning').length );
// console.log('#=#=#Tab 3 ' + $('.planning').length );
// console.log('#=#=#Tab 4 ' + $('div#tabs2_section > img.tab_spacer').length );
// console.log('#=#=# Tab ' + tab_cap + ' added.' );
var clr = '';
if (color == 1) { clr = 'changed' ; } // #0C0
if (color == 2) { clr = 'read_only' ; } // #FFA500
if (color == 3) { clr = 'mandatory' ; } // #E11A2C
if (color == 4) { clr = 'mandatory_populated'; } //
if (color == 5) { clr = 'foreign' ; } //
if (color == 6) { clr = 'itsm' ; } // #00BFFF
var def_mesg = '<p><h2>Nothing usefull in here yet (' + tab_cap + ')</h2></p>';
if ( tab_cap === 'ITSM+' ) {
// if ( bgcolor !== '' && txtcolor !=='') { setcolors(bgcolor,txtcolor); }
// https://usercenter.checkpoint.com/usercenter/portal/media-type/html/role/usercenterUser/page/default.psml/js_pane/supportId%2CCreateServiceRequestId
var hidestuffstate = ( $('#element\\.' + script + '\\.approval').is(':visible') ) ? ' ' : 'checked' ;
def_mesg = '<table width="100%"><tbody><tr><td><p><hr><p><h2>Open new TP case with our vendors.</h2><hr><p style="line-height:35px;">\
<a class="mybut tplink" target="_blank" href="https://mycase.cloudapps.cisco.com/case" > Cisco </a> \
<a class="mybut tplink" target="_blank" href="https://support.emc.com/servicecenter/createSR/" > EMC </a> \
<a class="mybut tplink" target="_blank" href="https://support.infoblox.com/app/ask" > Infoblox </a> \
<a class="mybut tplink" target="_blank" href="https://na4.salesforce.com/secur/login_portal.jsp?orgId=00D3000000001oV&portalId=06060000000D3gX"> Nimsoft </a> \
<a class="mybut tplink" target="_blank" href="https://support.avaya.com/service-requests/" > Avaya </a> \
<a class="mybut tplink" target="_blank" href="https://bto.bluecoat.com/" > Bluecoat </a> \
<a class="mybut tplink" target="_blank" href=https://usercenter.checkpoint.com/usercenter/portal/media-type/html/role/usercenterUser/page/default.psml/js_pane/supportId%2CCreateServiceRequestId > Checkpoint</a> \
<a class="mybut tplink" target="_blank" href=https://websupport.f5.com/casemanager/supportCaseStepOne.do > F5 </a> \
<a class="mybut tplink" target="_blank" href="https://partners.fortinet.com/FortiPartnerPortal/Application/Redirect.do?oid=4" > Fortinet </a> \
<a class="mybut tplink" target="_blank" href="https://casemanager.juniper.net/casemanager/#/create" > Juniper </a> \
<a class="mybut tplink" target="_blank" href="https://portal.ntt.eu/angora-cp-gui-eu?action=create-ticket" > NTT </a> \
<span class="tplink">palo alto </span>\
<a class="mybut tplink" target="_blank" href="https://my.pulsesecure.net/members/redirect/?application=casecenter" > Pulse Secure </a> \
<a class="mybut tplink" target="_blank" href="http://eservice.evercom.be/WorkOrder.do" > Evercom </a> \
<a class="mybut tplink" target="_blank" href="https://support.westcon.com/sigma/" > WestconGroup </a> \
<a class="mybut tplink" target="_blank" href="https://support.ca.com/irj/portal/anonymous/newhome" > CA </a> \
<p> <p><center>If you click one of these buttons you will be taken to the page where you can log a vendor case.<br>\
At the same time a cookie is placed that will be used to fill in fields in the vendor page.<br>\
The casenumber of the created case is captured and is available in the external reference page.<br>\
Let me know if it doesn\'t work or if you have something to add.</center><hr> <p> \
</td><td width="50%" valign="top"><p><hr><p><h2>Do you want to help?</h2><hr><p>\
What I need is: <ul><li>The url that will take me to the page for the vendor where we can create a new case.</li>\
<li>I need the url of the page(s) where we can fill the various parameters for the case.</li>\
<li>I need the url of the page where we receive the actual case number( and url).</li>\
<li>If possible for each of these pages a \'File -> Save Page As, Type: Web Page, complete\' </li>\
<li>Save me this in an archive and send it to <a href="mailto://[email protected]&subject=URL\'s and pages for vendor:" class=redlink> me </a>.</li><ul>\
</td></tr></tbody></table><p><h2><span>ITSM+ Tab Settings<span> <span style="width=400px;"> </span> <span style="left:800px;">ITSM+ hide stuff</span></h2> <hr><p>\
<input name=Scram class="tabchk" type=checkbox ' + my_tab('Scram') + ' title="Show/Hide this tab"/> <a href="' + $("span#scram > a:nth-child(1)").attr("href") + '" target=_blank class="mybut">SCRAM</a> \
<input name=Secret class="tabchk" type=checkbox ' + my_tab('Secret') + ' title="Show/Hide this tab"/> <a href="' + $("span#secret > a:nth-child(1)").attr("href") + '" target=_blank class="mybut">SECRET</a> \
<input name=Webex class="tabchk" type=checkbox ' + my_tab('Webex') + ' title="Show/Hide this tab"/> <a href="' + $("span#webex > a:nth-child(1)").attr("href") + '" target=_blank class="mybut">WEBEX</a> \
<input name=MOVEit class="tabchk" type=checkbox ' + my_tab('MOVEit') + ' title="Show/Hide this tab"/> <a href="' + $("span#moveit > a:nth-child(1)").attr("href") + '" target=_blank class="mybut">MOVEIT</a> \
<input name=hidestuff class="tabchk" type=checkbox ' + hidestuffstate + ' title="Show/Hide useless fields"/> Hide useless fields.<p>\
<input name=escal class="tabchk" type=checkbox ' + my_tab('Escalation') + ' title="Show/Hide this tab"/> <a >Escalation</a> \
<input name=stake class="tabchk" type=checkbox ' + my_tab('Stakeholders') + ' title="Show/Hide this tab"/> <a >Stakeholders</a>\
<input name=custom class="tabchk" type=checkbox ' + my_tab('Custom section') + ' title="Show/Hide this tab"/> <a >Custom section</a><p><hr><p> <p>\
<p><h2>The ITSM+ scripts that are available now :</h2><hr><p><ul><font class=redlink>\
<li><a class=redlink href="https://greasyfork.org/en/scripts/4566-itsm-use-default-mail-client/code/ITSM_Use_Default_Mail_client.user.js" title=" Send ITSM mails using outlook, Color your tasklist based on running SLA/OLA, and much more. ">Default Mail client script.</a></li></ul><p><ul>\
<li><a class=redlink href="https://greasyfork.org/scripts/10603-dark-theme/code/Dark%20theme.user.js" title=" ITSM dark theme script. ">Feel the atraction of the << DARK SIDE >>?</a></li>\
<li><a class=redlink href="https://greasyfork.org/scripts/8557-email-client-do/code/ITSM%20email_client_do.user.js" title=" Adds email address to the email_client_do page, the official ITSM web mail. ">ITSM web mail script.</a></li>\
</font></ul><p>Click the script name to install it<p>or find all the scripts right here: <a class=redlink href="https://greasyfork.org/en/scripts/search?q=ITSM">https://greasyfork.org</a> <hr>\
<p> <p>Background: <input type=color name=bg id=bg value="' + bgcolor + '"/> Text : <input type=color name=txt id=txt value="' + txtcolor + '"/>\
<a id=svclrs class=mybut >Save and use these colors</a> <a id=rstclrs class=mybut >Reset Colors</a> <p> <p><hr>';
}
// <input name=tabwebex type=checkbox /><a >WEBEX</a> https://support.ca.com/irj/portal/anonymous/newhome
// <li><a href="https://greasyfork.org/en/scripts/11075-itsm-top-page" title=" Taming the newly added top page button bar">ITSM button bar script.</a></li>\
// <li><a href="https://greasyfork.org/en/scripts/12174-itsmwebex" title="ITSM webex autofill meeting schedule">ITSM webex script.</a></li>\
// <li><a href="https://greasyfork.org/scripts/8524-itsm-external-reference/code/ITSM%20external%20reference.user.js" title=" Standardise input of thridparty casenrs RMS nr\'s etc.\n This allows ITSM+ to add the casenr to the tab\'s bar. ">ITSM handle external references script.</a>\
// <a href="http://eubebruphpbb/phpbb3_1/viewtopic.php?f=428&t=1067&sid=4deb91999ff40f1fb9c58f05dced1b51" target="_blank"><font style="color:yellow;background-color:#000;"> help needed! </font></a></li>\
if ( tab_cap === 'RMA') {
console.log('#=#= how many RMA? ' , rma_lijst.length);
if ( rma_lijst.length > 0 ) {
if ( rma_number === '<ITSM_EXTREF_RMA + ITSM_EXTREF_THIRDPARTY>' ) { clr = 'changed'; } else { clr = 'mandatory'; } // clr = 'foreign';
// if ( $('#sys_display\\.' + script + '\\.u_contract_ci').val() !== '' ) { serial_number = $('#sys_display\\.' + script + '\\.u_contract_ci').val(); }
def_mesg = '';
if ( rmalinks !== '' ) { def_mesg = '<p>' + rmalinks + '<p>'; } else { def_mesg = ''; }
var note;
var product = ( $('input#' + script + '\\.u_custom_text_3').val().split(';')[0] !== '' ) ? $('input#' + script + '\\.u_custom_text_3').val().split(';')[0] : ( $('#sys_display\\.' + script + '\\.u_product').val().indexOf('VIRT') == -1 ) ? $('#sys_display\\.' + script + '\\.u_product').val() : '' ;
if ( $('input#' + script + '\\.u_custom_text_3').val().split(';')[2] ) {
console.log('# Stored serial = ', $('input#' + script + '\\.u_custom_text_3').val().split(';')[2] );
serial_number = ( serial_number.indexOf('ITSM_') != -1 ) ? $('input#' + script + '\\.u_custom_text_3').val().split(';')[2] : serial_number ;
}
for (i=0;i<rma_lijst.length;i++) {
// #element\.incident\.work_notes\.additional
// #element\.incident\.work_notes\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > span:nth-child(1)
if ( $('tr#element\\.' + script + '\\.work_notes\\.additional').find('span:contains("=== RMA REQUEST ")').length > 0 ) {
var RMArec = $('#element\\.' + script + '\\.work_notes\\.additional').find('span:contains("=== RMA REQUEST ")').text();
// alert('found ' + RMArec);
clr = 'changed';
}
if ( rma_lijst[i][2].substr(1, 4) === 'ITSM' ) { var note = ' Add column \'Create\' to the \'External reference\' table, to get RMA creation date ' ; } else { note = '' ; }
def_mesg = def_mesg + '<p style="color:red">' + note + '</p><p><table><tr><td><pre><div id="rmaarea' + i + '" style="font-family:monospace;width:690px;height:280px;" class=faketextarea contenteditable>';
var def_mesg_txt = '\
\nIncident Number : ' + casenr + '\
\nCustomer name : ' + $('#' + script + '\\.company_label').val() + '\
\nSite : ' + $('#sys_display\\.' + script + '\\.location').val() + '\
\nCustomer name : ' + $('#sys_display\\.' + script + '\\.u_caller').val() + '\
\nCustomer Intervention : ' + client_ref + '\
\nProduct Family : ' + rma_lijst[i][1] + '\
\nProduct Code : ' + product + '\
\nDefect Serial Number : ' + serial_number + '\
\nShort problem description : ' + $('#' + script + '\\.short_description').val() + '\
\nRMA number : ' + rma_lijst[i][0] + '\
\nRMA creation date : ' + rma_lijst[i][2] + '\n\
\nDirectly delivered to customer : <MANUAL INPUT>\
\nNew Serial Number (if already known) : <MANUAL INPUT>\n\
\nMore details if necessary/relevant : <MANUAL INPUT>\n';
def_mesg_txt = def_mesg_txt.replace('<ITSM_CIMODEL_MANUFACT>','<span style="color:red;"><ITSM_CIMODEL_MANUFACT></span>');
def_mesg_txt = def_mesg_txt.replace('<ITSM_EXTREF_CLIENTREFNUM>','<span style="color:red;"><ITSM_EXTREF_CLIENTREFNUM></span>');
def_mesg_txt = def_mesg_txt.replace('<ITSM_CI_SN>','<span style="color:red;"><ITSM_CI_SN></span>');
def_mesg_txt = def_mesg_txt.replace(/<MANUAL INPUT>/g,'<span style="color:red;"><MANUAL INPUT></span>');
def_mesg = def_mesg + def_mesg_txt.replace('\n\n','<p>').replace('\n','<br>') + '</div></pre></td><td> </td></table> <hr><p><a id="rmahop_' + i.toString() + '" class="mybut"><span>Send RMA ' + rma_lijst[i][0] + '</span></a><hr>';
// #element\.incident\.work_notes\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3)
}
} else {
def_mesg = '<table><tr><td><div class="info_box">You must create an External reference entry with a <b>\'Vendor reference number / RMA\'</b>, before the RMA template appears.<p></div><p><a id="rmabut" class="mybut" >RMA</a>\
</td><td> </td></table>';
clr = '';
}
}
if ( tab_cap === 'Tab_2' ) {
def_mesg = '<p><a id="tab_alert" class="mybut"><span>Start alert</span></a> <a id="tab_alert_stp" class="mybut"><span>Stop alert</span></a> <p> <a id="newtpcase" class="mybut"><span>newcase</span></a><p><hr>\
<p> <p><hr>';
}
if ( tab_cap === 'Tab_3' ) {
def_mesg = '<p><a href="tel:00479982267">call me</a><p><textarea id=phpbbarea1 rows=5 cols=120></textarea><hr><p><a id=phpbb1 class="mybut"><span>Get Forum entry</span></a> <a id=phpbb2 class="mybut"><span>Get Forum entry2</span></a><p><textarea id=phpbbarea2 rows=5 cols=120></textarea><hr>';
}
if ( tab_cap === 'Tab_4' ) {
def_mesg = '<table><tr><td><div id=test123 class=faketextarea contenteditable>Normal text <br><span style="color:red;">Testing red text</span> <br>Normal text <br><span style="color:blue;">Testing blue text</span> </div></td>\
<td><textarea id=area3 rows=5 cols=80></textarea></td></tr>\
<tr><td><a id="clickme" class="mybut"><span>Click me </span></a> <a id="clickme1" class="mybut"><span>Click me 1</span></a> <a id="clickme2" class="mybut"><span>Click me 2</span></a></td></tr></table>';
}
if ( tab_cap === 'Tab_5+' ) {
var xmlurl = '/xmlhttp.do';
var xmltab = $('table#' + script + '\\.task_time_worked\\.task_table').attr('glide_list_query');
var xmltab1 = $('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr:nth-child(1)').attr('sys_id');
console.log('#=#=# xmltab found', $('table#' + script + '\\.task_time_worked\\.task_table').attr('glide_list_query') );
var xmldata = 'sysparm_processor=com.glide.ui_list_edit.AJAXListEdit&sysparm_type=set_value&sysparm_table=task_time_worked&sysparm_first_field=task_time_worked.u_number&sysparm_omit_links=&sysparm_xml=';
xmldata += encodeURI('<record_update table="task_time_worked" field="task" query="' + xmltab + '"><record sys_id="' + xmltab1 + '" operation="update"><field name="u_billable" modified="true" value_set="true" dsp_set="false"><value>true</value></field></record></record_update>').replace(/=/g,'%3D').replace(/\//g,'%2F');
xmldata += '&ni.nolog.x_referer=ignore';
xmldata += '&x_referer=u_request.do%3Fsys_id%3D' + xmltab1 + '%26sysparm_record_target%3Dtask%26sysparm_record_row%3D2%26sysparm_record_rows%3D2%26sysparm_record_list%3Dactive%253Dtrue%255Eassigned_to%253Djavascript%253AgetMyAssignments%2528%2529%255Esys_domain_number%2521%253D0%255Eu_service_centreIN0b37a5356fcf8d406c265ebd5d3ee462%255EORu_service_centreISEMPTY%255EORassignment_group%253Djavascript%253AgetMyGroups%2528%2529%255EORu_responsible_owner_group%253Djavascript%253AgetMyGroups%2528%2529%255EORu_owner_group%253Djavascript%253AgetMyGroups%2528%2529%255EORDERBYDESCsys_updated_on';
def_mesg = '<p><a href="tel:00479982267">call me</a><p><textarea id=area1 rows=5 cols=120></textarea><hr><p><a id=xmlhop class="mybut"><span>We zien wel</span></a> <a id=xmlget class="mybut"><span>Get something then</span></a><p><textarea id=area2 rows=5 cols=120></textarea><hr><p> <p><a id="serialsearch" class="mybut"><span>test button</span></a>\
<span class="sprite1 button1"></span><span id="btnclk" class="sprite1 button2"></span>\
<p><a href="xmpp:[email protected]" > <img src=' + GM_getResourceURL('jabbericon') + ' class=i14x title=" IM Johan " /> </A>\
<p><a href="xmpp:[email protected]" > <img src=' + GM_getResourceURL('jabbericon') + ' class=i14x title=" IM me " /> </A>\
<p><a href="xmpp:[email protected]" > <img src=' + GM_getResourceURL('jabbericon') + ' class=i14x title=" IM me " /> </A><p> <p>\
<p><a href="sip:[email protected]" > <img src=' + GM_getResourceURL('lyncicon' ) + ' class=i16x16 title=" IM me " /> </A>\
<p><a href="im:<sip:[email protected]>" > <img src=' + GM_getResourceURL('lyncicon' ) + ' class=i16x16 title=" IM me " /> </A>\
<p><a href="callto:sip:[email protected]" > <img src=' + GM_getResourceURL('lyncicon' ) + ' class=i16x16 title=" IM me " /> </A>\
';
}
//
// Here we insert the TAB
//
//console.log('#=#=# addtab1 ' + $('#tabs2_section').find('h3').length + ' [' + $('#tabs2_section > h3:nth-child(10) > span:nth-child(1) > span:nth-child(2)').text() + ']'); //
//console.log('#=#=# addtab2 ' + $('#tabs2_section > h3:nth-child(12)').length + ' ' + tab_cap); // #tabs2_section > h3:nth-child(10) #tabs2_section > h3:nth-child(12) > span:nth-child(1)
//console.log('#=#=#Tab 4 ' + $('div#tabs2_section > img.tab_spacer:nth-child(12)').length );
//$('div#tabs2_section > img.tab_spacer:nth-child(10)').css('border','3px solid red');
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0" style=";padding-right:0px;"><span id="' + tab_cap + '" class="' + clr + '" style="margin-right:2px"><img src="images/s.gifx" alt="" style="width: 4px; height: 12px; margin: 0px;"></img></span><span class="tab_caption_text"> ' + tab_cap + ' </span></span></h3>\
<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('div#tabs2_section > h3:nth-child(12)') );
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" /><span class="tab_header"><span class="tabs2_tab mytab" tabindex="0" style=";padding-right:0px;"><span id="' + tab_cap + '" class="' + clr + '" style="margin-right:2px"><img src="images/s.gifx" alt="" style="width: 4px; height: 12px; margin: 0px;"></img></span><span class="tab_caption_text"> ' + tab_cap + ' </span></span></span>\
').insertBefore( $('div#tabs2_section > img.tab_spacer:nth-child(10)') );
}
//
// Here we build the TAB Section annotation-wrapper
//
var tabsect = '\
<table tab_caption="' + tab_cap + '" class="tabs2_section mytab wide" cellspacing="0" style="display:none;"><tbody><tr style="padding:4px;" class="header">\
<td class="column_head annotation" nowrap="true" data-type="section_head" data-id="' + tab_cap + '"> <span style="font-size:10.6667px;padding:4px;">' + tab_cap + '</span></td>\
<td class="column_head annotation" width="100%" align="right" data-type="section_head" data-id="' + tab_cap + '">\
<a class="tabs_toggle_button" tabindex="0"><img class="tabs2_toggle button" width="16px" height="16px" src="images/tab_toggle.gifx" title="Toggle tabs on / off" onclick="tabs2Toggle()"></img></a>\
<a><img id="img.' + tab_cap + '" src="images/section_reveal.gifx" style="cursor:pointer; margin: 0px;" title="Collapse" data-id="' + tab_cap + '"></img></a>\
</td></tr></tbody></table>';
//
// Here we insert the TAB Section
//
$( tabsect + '<span id="section_tab.' + tab_cap + '" class="tabs2_section mytab" tab_caption_raw="' + tab_cap + '" tab_caption="' + tab_cap + '" style="display:none;">' + def_mesg + '<p> <p> <p> <p></span>' ).insertAfter( $('#tabs2_section') );
//
//
//
if ( tab_cap === 'Tab_2' ) {
$('#tab_alert').on('click', function () {
tab_alert('Tab_3', 'on', 'changed');
});
$('#tab_alert_stp').on('click', function () {
console.log('#=#=# clearInterval tabflash');
tab_alert('Tab_3', 'off', 'changed');
});
$('#newtpcase').on('click', function () {
console.log('#=#=# set newcase "COOKIE" ');
GM_setValue('newcase', 'cisco,123test456,http://didata.be');
});
}
if ( tab_cap === 'Tab_3' ) { // ucp.php?mode=login
$('#phpbb1').on('click', function () {
gm_http();
});
}
if ( tab_cap === 'Tab_4' ) {
$('#clickme').on('click', function () {
var z = $('#test123').text();
alert(z);
$('#area3').val( $('#test123').text() );
});
$('#clickme1').on('click', function () {
$('#area3').val( $('#test123').val() );
});
$('#clickme2').on('click', function () {
$('#area3').val( $('#test123').html().replace(/<br>/ig,'\n').replace(/<p>/ig,'\n\n').replace(/<\/?[^>]+(>|$)/g, '') );
});
}
if ( tab_cap === 'Tab_5+' ) {
$('#btnclk').on('click', function() {
var p = $('#btnclk').css('background-position');
console.log('# ' + p);
p = p.replace(/px/g,'').split(' ')[1];
console.log('# ' + p);
p = '0px ' + ( p - 16 ) + 'px';
console.log('# ' + p);
$('#btnclk').css('background-position', p ) ;
});
console.log('#=#=# add text to area1');
$('#area1').val( 'query=' + xmltab + '\nsys_id=' + xmltab1 );
$('#xmlhop').on('click', function () {
console.log('#=#=# xmlhop clicked ');
$('#area1').val( xmldata );
var httprqst = new XMLHttpRequest();
httprqst.open("POST", xmlurl, true);
httprqst.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Send the proper header information along with the request
httprqst.setRequestHeader("Content-length", xmldata.length);
httprqst.setRequestHeader("Connection", "close");
httprqst.onreadystatechange = function() { // Call a function when the state changes.
if ( httprqst.readyState == 4 ) {
if ( httprqst.status == 200) {
$('#area2').val(httprqst.responseText);
console.log(['#=#=# ',
httprqst.status,
httprqst.statusText,
httprqst.readyState,
httprqst.responseHeaders,
httprqst.responseText,
httprqst.finalUrl,
responseXML
].join("\n"));
} else {
$('#area2').val(httprqst.status + ' ' + httprqst.statusText);
console.log(['#=#=# oeps',
httprqst.status,
httprqst.statusText
].join("\n"));
}
}
}
httprqst.send(xmldata);
});
$('#xmlget').on('click', function () {
console.log('#=#=# xmlget clicked ');
$('#area1').val( xmldata );
var httprqst = new XMLHttpRequest();
httprqst.open("GET", xmlurl, true);
httprqst.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Send the proper header information along with the request
httprqst.setRequestHeader("Content-length", xmldata.length);
httprqst.setRequestHeader("Connection", "close");
httprqst.onreadystatechange = function() { // Call a function when the state changes.
if ( httprqst.readyState == 4 && httprqst.status == 200) {
$('#area2').val(httprqst.responseText);
console.log(['#=#=# ',
httprqst.status,
httprqst.statusText,
httprqst.readyState,
httprqst.responseHeaders,
httprqst.responseText,
httprqst.finalUrl,
responseXML
].join("\n"));
} else {
$('#area2').val(httprqst.readyState + ' ' + httprqst.status + ' ' + httprqst.statusText);
console.log(['#=#=# oeps ',
httprqst.readyState,
httprqst.status,
httprqst.statusText
].join("\n"));
}
}
httprqst.send(xmldata);
});
$('#serialsearch').on('click', function () {
console.log('#=#=# serialsearch clicked ');
var watch = serialsearch();
console.log('#=#=# serialsearch ' , watch);
// $('#area2').val(it);
$('#area2').val(it + '\n\n\n' + watch);
});
}
if ( tab_cap === 'ITSM+' ) {
$('A.tplink').on('click' , function() {
console.log('# tplink clicked ' );
GM_deleteValue('ourcase');
GM_deleteValue('oursubj');
GM_deleteValue('ourcust');
GM_deleteValue('ourseri');
GM_setValue('ourcase', casenr);
GM_setValue('oursubj', $('#' + script + '\\.short_description').val() );
GM_setValue('ourcust', CustNM );
console.log('# ourcase set to: ' + casenr, CustNM );
var tmpser = $('input#' + script + '\\.u_custom_text_3').val();
if ( tmpser && tmpser.indexOf(';') > -1) {
serial_number = $('input#' + script + '\\.u_custom_text_3').val().split(';')[2];
}
// alert('tplink clicked 3' , serial_number);
if ( typeof serial_number === 'undefined' || serial_number.indexOf('<ITSM') > -1 || serial_number === '' ) {
if ( $('#sys_display\\.' + script + '\\.u_contract_ci').val() !== '' ) { GM_setValue('ourseri', $('#sys_display\\.' + script + '\\.u_contract_ci').val() ); } else { GM_setValue('ourseri', ''); }
} else {
GM_setValue('ourseri', serial_number);
}
// dt.setHours( dt.getHours() + 2 );
// var expiredt = wkd[dt.getDay()] + ' ' + dd(dt.getDate()) + '-' + mnt[dt.getMonth()] + '-' + dt.getFullYear() + '-' + dt.getHours() + ':' + dt.getMinutes();
var dt = new Date();
GM_setValue('casedt', dt);
console.log('# ourcase set to: ' + casenr , serial_number, CustNM, dt );
// alert('tplink clicked 4');
chk4nwcstmr = setInterval( function() {
console.log('#=#= call chk4nwcs');
chk4nwcs();
} ,10000);
});
$('.tabchk').on('click' , function() {
var tb = $(this).attr('name');
var st = $(this).is(':checked');
// alert(tb + ' ' + st + ' clicked');
if ( tb === 'hidestuff') {
console.log('#=#= tabchk ' + tb + ' ' + st + ' clicked ' + $('#element\\.' + script + '\\.approval').is(':visible') );
if ( st ) {
hide_stuff(1); // hide
GM_setValue('hidestuff',1);
console.log('#=#= tabchk ' + tb + ' hide ');
} else {
hide_stuff(0); // show
GM_setValue('hidestuff',0);
console.log('#=#= tabchk ' + tb + ' show ');
}
}
if ( tb === 'Secret') { tb = 'Secret'; }
if ( tb === 'Scram') { tb = 'Scram'; }
if ( tb === 'Webex') { tb = 'Webex'; }
if ( tb === 'MOVEit') { tb = 'MOVEit'; }
if ( tb === 'escal') { tb = 'Escalation'; }
if ( tb === 'stake') { tb = 'Stakeholders'; }
if ( tb === 'custom') { tb = 'Custom section';}
if (st) {
tab_show(tb);
mytabs[tb] = 1;
} else {
tab_hide(tb);
mytabs[tb] = 0;
}
GM_setValue('mytabs', JSON.stringify(mytabs) );
});
$('#bg').on('change', function() {
bgcolor = $('#bg').val();
setcolors(bgcolor, txtcolor)
});
$('#txt').on('change', function() {
txtcolor = $('#txt').val();
setcolors(bgcolor, txtcolor)
});
$('#rstclrs').on('click', function() {
alert('Clearing the bg and txt colors');
GM_deleteValue('ITSMbgcolor' );
GM_deleteValue('ITSMtxtcolor');
parent.top.location = parent.top.location.href;
});
$('#svclrs').on('click', function() {
alert('Saving and applying the bg and txt colors');
GM_setValue('ITSMtxtcolor', txtcolor);
GM_setValue('ITSMbgcolor' , bgcolor );
parent.top.location = parent.top.location.href;
});
}
if ( tab_cap === 'RMA' ) {
$('#rmabut').on('click', function() {
if ($('#rmabut').text() === 'RMA') { GM_setValue('newrma', 'newrma'); }
// #list_nav_u_request\.u_ext_ref_no\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(3)
if( $('#list_nav_' + script + '\\.u_ext_ref_no\\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(2)').length > 0 ) { // old or new ITSM
$('#list_nav_' + script + '\\.u_ext_ref_no\\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(2)')[0].click();
} else {
$('#list_nav_' + script + '\\.u_ext_ref_no\\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(3)')[0].click();
}
// Save the update
GM_setValue('activetab','');
});
// '#list_nav_' + script + '\.u_ext_ref_no\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(2)'
for (j=0;j<rma_lijst.length;j++) {
var onclickid = '#rmahop_' + j.toString();
$( onclickid ).on('click', function () {
var p = $(this);
var areaid = '#' + p.attr('id').replace('hop_','area');
var rma_t = $( areaid ).html().replace(/<br>/ig,'\n').replace(/<p>/ig,'\n\n').replace(/<\/?[^>]+(>|$)/g, '').replace(/</ig,'<').replace(/>/ig,'>');
var rmanr = $(onclickid).text().replace('Send RMA','').trim();
// ' + rma_lijst[j][0] + '
$('#' + script + '\\.work_notes').val('==== RMA REQUEST '+ rmanr +' SEND ====\n' + rma_t.replace(/ /g,'').replace(/:/g,' :'));
rma_t = rma_t + '\n\nDo not change the info in this mail!!\nInstead change the info in the textarea under the RMA tab.\n\nYou can change the font to a non-proportional one like: Consolas, Courier New or Terminal to align the text in the mail.';
var mail_lnk = 'mailto://[email protected]?subject=' + encodeURIComponent('RMA\'s for [' + $('#' + script + '\\.company_label').val() + '] ' + casenr) + '&body=' + encodeURIComponent( rma_t ); //.split('\n').join('%0D')
console.log('#=#=# mail_lnk', mail_lnk );
window.top.location = mail_lnk;
console.log('#=#=# click rmahop ' , rmanr );
return false; //.replace(/ /g,'\t')
unsafeWindow.gsftSubmit(document.getElementById('sysverb_update_and_stay'));
});
}
}
// GM_xmlhttpRequest({
// method: "POST",
// url: xmlurl,
// data: xmldata,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded"
// },
// onload: function(response) {
// console.log('#=#=# we have results ');
// $('#area2').val(response.responseText);
// console.log(['#=#=# ',
// response.status,
// response.statusText,
// response.readyState,
// response.responseHeaders,
// response.responseText,
// response.finalUrl,
// responseXML
// ].join("\n"));
// }
// });
tab_cap = tab_cap.replace('+', '\\+');
$('img#img\\.' + tab_cap).on('click', function() {
console.log('#=#=# img hide-reveal ' + tab_cap + ' clicked. ' + $('span#section_tab\\.' + tab_cap ).length );
if ( $(this).attr('src') === 'images/section_hide.gifx' ) {
$(this).attr('src','images/section_reveal.gifx').attr('title','Collapse');
console.log('#=#=# show span#' + tab_cap );
$('span#section_tab\\.' + tab_cap ).slideDown();
} else {
$(this).attr('src','images/section_hide.gifx').attr('title','Expand');
console.log('#=#=# hide span#' + tab_cap );
$('span#section_tab\\.' + tab_cap ).slideUp();
}
});
TabClickHover(tab_cap);
}
function TabClickHover(tab_cap){
$('span#' + tab_cap ).parent().on('click', function() {
console.log('#=#=# Tab ' + tab_cap + ' clicked.' );
GM_setValue('activetab', tab_cap);
$('span.tabs2_active' ).removeClass("tabs2_active");
$('span#' + tab_cap).parent().addClass( "tabs2_active");
$('span.tabs2_section').each( function() {
var obj = $(this);
// console.log('#=#=# section ' + obj.attr('tab_caption') + '.' );
if (obj.attr('tab_caption') === tab_cap.replace('\\','') ) {
console.log('#=#=# Show section span ' + tab_cap + '.' );
if ( $('img#img\\.' + tab_cap).attr('src') !== 'images/section_hide.gifx' ) { $( this ).show(); }
} else {
if (obj.attr('tab_caption') !== 'Request' && obj.attr('tab_caption') !== 'Incident') { $( this ).hide(); }
}
});
$('table.tabs2_section').each( function() {
var obj = $(this);
if (obj.attr('tab_caption') === tab_cap.replace('\\','') ) {
console.log('#=#=# Show section tbl ' + tab_cap + '.' );
$( this ).show();
} else {
if (obj.attr('tab_caption') !== 'Request' && obj.attr('tab_caption') !== 'Incident') { $( this ).hide(); }
}
});
});
// console.log('#=#=# Tab click added ');
$('span#' + tab_cap ).parent().hover(
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
// console.log('#=#=# Tab hover added ');
}
function insertTab(tab_cap,color,state){
var clr = '';
if (color == 1) { clr = 'changed' ; } // #0C0
if (color == 2) { clr = 'read_only' ; } // #FFA500
if (color == 3) { clr = 'mandatory' ; } // #E11A2C
if (color == 4) { clr = 'mandatory_populated'; } //
if (color == 5) { clr = 'foreign' ; } //
if (color == 6) { clr = 'itsm' ; } // #00BFFF
var def_mesg = '<p><h2>Nothing usefull in here yet (' + tab_cap + ')</h2></p>';
def_mesg = '<table><tr><td><div class="info_box">You must create an External reference entry with a <b>\'Vendor reference number / RMA\'</b>, before the RMA template appears.<p></div><p><a id="hoplabut" class="mybut" >RMA</a>\
</td><td> </td></table>';
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0" style=";padding-right:0px;"><span id="' + tab_cap + '" class="' + clr + '" style="margin-right:2px"><img src="images/s.gifx" alt="" style="width: 4px; height: 12px; margin: 0px;"></img></span><span class="tab_caption_text"> ' + tab_cap + ' </span></span></h3>\
<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('div#tabs2_section > h3:nth-child(12)') );
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" /><span class="tab_header"><span class="tabs2_tab mytab" tabindex="0" style=";padding-right:0px;"><span id="' + tab_cap + '" class="' + clr + '" style="margin-right:2px"><img src="images/s.gifx" alt="" style="width: 4px; height: 12px; margin: 0px;"></img></span><span class="tab_caption_text"> ' + tab_cap + ' </span></span></span>\
').insertBefore( $('div#tabs2_section > img.tab_spacer:nth-child(10)') );
}
//
// Here we build the TAB Section annotation-wrapper
//
var tabsect = '\
<table tab_caption="' + tab_cap + '" class="tabs2_section mytab wide" cellspacing="0" style="display:none;"><tbody><tr style="padding:4px;" class="header">\
<td class="column_head annotation" nowrap="true" data-type="section_head" data-id="' + tab_cap + '"> <span style="font-size:10.6667px;padding:4px;">' + tab_cap + ' </span></td>\
<td class="column_head annotation" width="100%" align="right" data-type="section_head" data-id="' + tab_cap + '">\
<a class="tabs_toggle_button" tabindex="0"><img class="tabs2_toggle button" width="16px" height="16px" src="images/tab_toggle.gifx" title="Toggle tabs on / off" onclick="tabs2Toggle()"></img></a>\
<a><img id="img.' + tab_cap + '" src="images/section_reveal.gifx" style="cursor:pointer; margin: 0px;" title="Collapse" data-id="' + tab_cap + '"></img></a>\
</td></tr></tbody></table>';
//
// Here we insert the TAB Section
//
$( tabsect + '<span id="section_tab.' + tab_cap + '" class="tabs2_section mytab" tab_caption_raw="' + tab_cap + '" tab_caption="' + tab_cap + '" style="display:none;">' + def_mesg + '<p> <p> <p> <p></span>' ).insertAfter( $('#tabs2_section') );
//
//
//
TabClickHover(tab_cap);
$('#hoplabut').on('click', function() {
if( $('#list_nav_' + script + '\\.u_ext_ref_no\\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(2)').length > 0 ) { // old or new ITSM
$('#list_nav_' + script + '\\.u_ext_ref_no\\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(2)')[0].click();
} else {
$('#list_nav_' + script + '\\.u_ext_ref_no\\.u_task > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > span:nth-child(1) > button:nth-child(3)')[0].click();
}
GM_setValue('activetab','');
});
console.log('#=# Inserted Tab ' + tab_cap , clr, state);
}
function gm_http() {
var sid = '';
var post_content = '';
console.log('#=#=# phpbb1 clicked ');
GM_xmlhttpRequest({
method: "POST",
// data: 'mode=login&username=user.name&password=QAZwsx123',
// user: 'michel.hegeraat', password: 'ZXCsdf456!', only works with basic authentication
data: 'mode=login&username=michel.hegeraat&password=ZXCsdf456!',
url: 'http://eubebruphpbb/phpbb3_1/ucp.php',
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
onerror: function(response) {
console.log('#=#=# post error response ....', response.readyState, response.status, response.statusText);
},
onload: function(response) {
console.log('#=#=# post response ....', response.readyState, response.status, response.statusText, response.finalUrl);
post_content = response.responseHeaders;
var u = post_content.indexOf('sid=') + 4 ;
sid = post_content.substr(u,32 );
$('#phpbbarea1').val( post_content + '\nsid=' + sid + '\n\n' + response.responseText+ '\n\n' + response.responseText.indexOf('You have been successfully logged in') );
gm_http2( post_content, sid );
}
});
console.log('#=#=# done with post ....' );
}
function gm_http2( post_content, sid ) {
console.log('#=#=# continue with get ....' , sid);
GM_xmlhttpRequest({
method: "GET",
url: 'http://eubebruphpbb/phpbb3_1/viewtopic.php?f=428&t=927&sid=' + sid,
headers: post_content ,
onprogress: function(response) {
console.log('#=#=# get onprogress response ....', response.readyState, response.readyState, response.status, response.statusText);
},
ontimeout: function(response) {
console.log('#=#=# get ontimeout response ....', response.readyState, response.readyState, response.status, response.statusText);
},
onerror: function(response) {
console.log('#=#=# get onerror response ....', response.readyState, response.readyState, response.status, response.statusText);
},
onload: function(response) {
console.log('#=#=# get response ....', response.readyState, response.status, response.statusText, response.finalUrl);
$('#phpbbarea2').val(response.responseHeaders + '\n\n\n\n' + response.responseText);
}
});
console.log('#=#=# done with get ....' );
}
function tabs_tpcases() {
console.log('##== tabs_tpcases start');
var fupload = '';
var caselinks ='';
var row = 1;
var srnr = 0;
var vdr = '';
var lnk = '';
var cse,vndr,url,ctpe,cmp,dt,cdt ; // u_ext_ref_no.u_task_table
var exst = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(1) ').length; // old
// new #row_u_request\.u_ext_ref_no\.u_task_0568754a0fb9c6c8991ffc5ce1050e88 #u_request\.u_ext_ref_no\.u_task_table > tbody:nth-child(2)
// console.log('##== exst=', exst , $('#' + script + '\\.u_ext_ref_no\\.u_task_table').attr('grand_total_rows'), $('#' + script + '\\.u_ext_ref_no\\.u_task_table').attr('last_row') , $('#' + script + '\\.u_ext_ref_no\\.u_task_table').attr('id') );
if ( exst > 0 ) {
ctpe = findcol( script + '.u_ext_ref_no.u_task_table','u_ext_ref_no.u_reference_type');
cse = findcol( script + '.u_ext_ref_no.u_task_table','u_ext_ref_no.u_reference_number');
vndr = findcol( script + '.u_ext_ref_no.u_task_table','u_ext_ref_no.u_description');
url = findcol( script + '.u_ext_ref_no.u_task_table','u_ext_ref_no.u_url');
cmp = findcol( script + '.u_ext_ref_no.u_task_table','u_ext_ref_no.u_company');
dt = findcol( script + '.u_ext_ref_no.u_task_table','u_ext_ref_no.sys_created_on');
console.log('##== cols=', cse, vndr, url, cmp , dt );
}
while ( exst > 0 ) {
// What kind of reference is this
ref_type = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + ctpe + ') ').text();
srnr = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + cse + ') ').text();
vdr = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + vndr + ') ').text();
if ( $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + url + ') > a:nth-child(1)').length > 0 ) {
if (vdr === '') { vdr = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + cmp + ') ').text(); }
lnk = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + url + ') > a:nth-child(1) ').attr('href');
}
// ref_type = Vendor reference number / RMA
if ( ref_type === 'Vendor reference number / RMA' ){
var TableDatarows = [];
if (dt > 0) { cdt = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + dt + ') ').text().substr(0,11); } else { cdt = '<ITSM_EXTREF_RMA_DATE>';}
if (vdr === '') { vdr = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ') > td:nth-child(' + cmp + ') ').text(); }
if ( vdr !=='' && srnr !== '' ) {
rma_number = srnr;
vendor_name = vdr;
TableDatarows.push(srnr);
TableDatarows.push(vdr);
TableDatarows.push(cdt);
rma_lijst.push(TableDatarows);
}
if ( lnk.substr(0,4) === 'http' && lnk.length > 10) {
rmalinks = rmalinks + '<SPAN id="cases' + row + '" class="tprma" style="">' + vdr.toUpperCase() + ' RMA: <a class="mybut" href="' + lnk + '" target="_blank">' + srnr + '</a></SPAN><br>';
}
}
if ( vdr.indexOf('Internal') > -1 ) {
vdr = 'int'
}
// ref_type =Client reference number
if ( ref_type === 'Client reference number' || ref_type === 'Service cross reference / Internal' ){
if ( srnr !== '' ) { client_ref = srnr; }
}
console.log('##== vals=', srnr, vdr, lnk );
if ( lnk.length > 10 && vdr.length > 1 ) { // lnk.substr(0,4) === 'http' &&
if (caselinks !== '') { caselinks = caselinks + '<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />'; }
if ( srnr.indexOf('CSC') > -1 ) { vdr = 'BUGID'; }
fupload = '';
if (vdr.toUpperCase() === 'CISCO') { fupload = ' <a class=mybut href=https://cway.cisco.com/csc/index.html?requestID=' + srnr +' title="Upload files to ' + vdr + '" target="_blank"><b>?</b></a>'; }
if (vdr.toUpperCase() === 'INFOBLOX') { fupload = ' <a class=mybut href=https://bloxdrop.infoblox.com title="Upload files to ' + vdr + '" target="_blank">?</a>'; }
if (vdr.toUpperCase() === 'EMC') { fupload = ' <a class=mybut href=https://supportfiles.emc.com/SRAttachments/upload4SR.aspx?Usertype=SRM&SRNum=' + srnr + ' title="Upload files to ' + vdr + '" target="_blank"><b>?</b></a>'; }
caselinks = caselinks + '<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="cases' + row + '" class="tab_caption_text tpcases" style="">' + vdr.toUpperCase() + ': <a class="mybut" href="' + lnk + '" target="_blank">' + srnr + '</a>' + fupload + '</SPAN></span></h3>';
}
row++;
exst = $('#' + script + '\\.u_ext_ref_no\\.u_task_table > tbody:nth-child(2) > tr:nth-child(' + row + ')').length;
}
console.log('##== case links' , caselinks.length);
if (caselinks !== '') {
console.log('##== case links', $('#tabs2_section > h3:nth-child(12)' ).length );
// $('#tabs2_section').append(caselinks );
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$(caselinks + '<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > h3:nth-child(12)' ) );
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />' + caselinks).insertBefore( $('#tabs2_section > img.tab_spacer:nth-child(10)' ) );
}
}
$('span[id^=cases]' ).parent().hover(
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
}
function tabs_move(tab_class,color) {
// Hide orig Contract change tab and make a new on further on using fn tabs_move()
// $('#tabs2_section > h3:nth-child(12)').addClass('planning');
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('div#tabs2_section > h3.tab_header:nth-child(8)').addClass('contractchange').css('display','none').next().css('display','none');
$('.' + tab_class).clone().insertBefore( $('#tabs2_section > h3:nth-child(12)') );
$('#tabs2_section > h3:nth-child(12)').attr('style','');
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > h3:nth-child(13)' ) );
$('#tabs2_section > h3:nth-child(12) > span:nth-child(1)').on('click', function() { // if new tab clicked
$('span.tabs2_active').removeClass("tabs2_active");
$('#tabs2_section > h3:nth-child(12) > span:nth-child(1)').addClass("tabs2_active");
console.log('New contract change tab clicked ');
$('div#tabs2_section > h3.tab_header:nth-child(8) > span:nth-child(1)')[0].click(); // click hidden tab :-)
});
$('#tabs2_section > h3:nth-child(12) > span:nth-child(1)').hover( // if new tab hovered
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
} else {
$('div#tabs2_section > img:nth-child(6)').next().addClass('contractchange');
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > img.tab_spacer:nth-child(10)') );
$('.' + tab_class).clone().insertBefore( $('#tabs2_section > img.tab_spacer:nth-child(11)') );
$('div#tabs2_section > img:nth-child(6)').next().css('display','none').next().css('display','none');
$('#tabs2_section > h3.contractchange:nth-child(11) > span:nth-child(1)').hover( // if new tab hovered
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
$('h3.contractchange:nth-child(11)').on('click', function() { // if new tab clicked
$('span.tabs2_active').removeClass("tabs2_active");
$('h3.contractchange:nth-child(11) > span:nth-child(1)').addClass("tabs2_active");
console.log('New contract change tab clicked ');
$('h3.contractchange:nth-child(8) > span:nth-child(1)')[0].click(); // click hidden tab :-)
});
}
}
function case_tabs_hover() {
var case_div_timer;
$('span.tpcases').hover( function(e) {
var p = e.target;
var pos = $('#' + p.id).offset();
Xco = pos.top + 20;
Yco = pos.left;
console.log('##== hovering', Xco , Yco , $('#' + p.id).text() );
var phntxt;
var mltxt;
var t4c = '';
var shds = $('#' + script + '\\.short_description').val();
t4c = $('#' + script + '\\.work_notes').val();
// if ( t4c === '' ) { t4c = $('#' + script + '\\.comment').val(); }
mailaddr = '';
subj = '';
phnnr = '';
var casetxt = $('#' + p.id).text().split(':');
var vdr = casetxt[0].trim();
if ( vdr === 'CISCO') {
tit = 'Cisco TAC';
phnnr = '+3227045555';
mailaddr = '[email protected]';
subj = 'SR {case} : ';
}
if ( vdr === 'EMC') {
tit = 'EMC Support';
phnnr = '0080077179';
mailaddr = '[email protected]';
subj = 'SR{case} - ';
}
if ( vdr === 'INFOBLOX') {
tit = 'Infoblox Support';
phnnr = '+3232590440';
mailaddr = '[email protected]';
subj = '[' + CustNM +'] '+ shds +' [Incident: {case}]';
}
if ( vdr === 'NIMSOFT') {
tit = 'Nimsoft/CA Support';
phnnr = '0080081175';
mailaddr = '[email protected]';
subj = 'Nimsoft Case {case}:';
}
if ( vdr === 'F5') {
tit = 'F5 Support';
phnnr = '+1180011275435';
}
if ( vdr === 'AVAYA') {
tit = 'Avaya Support';
phnnr = '+3227106187';
}
if ( vdr === 'JUNIPER') {
tit = 'Juniper Support';
phnnr = '0080072895';
mailaddr = '[email protected]';
subj = 'Case {case}:';
}
if ( vdr === 'FORTINET') {
tit = 'Fortinet Support';
phnnr = '+33489870555';
}
if ( vdr === 'WESTCON') {
tit = 'Fortinet Support';
phnnr = '+3224610170';
mailaddr = '[email protected]';
subj = 'Westcon Case {case}:';
}
var maildet = '';
var tpcase = casetxt[1].replace('?','').trim();
var mlto = mailaddr;
var mlcc = mailaddr;
subj = subj.replace('{case}', tpcase);
if ( GM_getValue('tpcase_'+ tpcase ) ) {
console.log('# Found tpcase_'+ tpcase);
casedetails = GM_getValue('tpcase_'+ tpcase ).split(';');
if ( casedetails[0].length > 1 ) { tit = casedetails[0]; }
if ( casedetails[1].length > 1 ) { phnnr = casedetails[1]; }
if ( casedetails[2].length > 1 ) { mlto = casedetails[2]; }
if ( casedetails[3].length > 1 ) { subj = casedetails[3]; }
} else {
console.log('# Not found tpcase_'+ tpcase);
}
if ( phnnr !== '' ) {
phntxt = '<a class="phnlnk" title="Call ' + tit + ' on ' + phnnr + '" href="tel:' + phnnr + '"><img class="phncl" src="images/mobile/phone.gifx" height="14" width="14"></a><b> ' + phnnr + ' </b>';
} else {
phntxt = '';
}
// phntxt += '<a class="phnlnk" id=casedet title="Add case details" style="float:right;"><img height="14" width="14" src=images/icons/business_services.gifx /></a>'; style="background-color:#ccc;border: solid 3px #ccc;border-radius:7px;padding:7px 7px 0px 7px;"
if ( mailaddr !== '' ) {
maildet = 'mailto://' + mlto + '?subject=' + subj + '&CC=' + mlcc + '&body='; // onclick="alert(\'clicked\');tpcase_mailclick(\'' + maildet + '\');"
mltxt = '<a id=tpcm class="phnlnk" title="Mail ' + tit + '" ><img height="14" width="14" class="mllnk" src="images/mobile/email.gifx"></img></a><b> ' + mlto + ' </b>'
// mltxt = mltxt + '<br><a class="phnlnk" title="Mail ' + tit + '" href="mailto://' + mlto + '?subject=' + subj + '&CC=' + mlcc + '&body=' + t4c + '"><img height="14" width="14" class="mllnk" src="images/mobile/email.gifx"></img></a><b> ' + mlto + ' </b>';
} else {
mltxt = '';
}
if ($("#case-div").length > 0) {
$("#case-div").remove();
if ($("#tpcase-set").length > 0) {
$("#tpcase-set").remove();
}
}
if ( phntxt !== '' || mltxt !== '' ) {
case_div_timer = setTimeout(function() {
$("body").append('<div id="case-div" class="mypopup" title="Click to close" ><span>' + phntxt + '</span><p><span>' + mltxt + '</span><br><span id=tpset style="float:right;line-height:10px;font-size:10px;"><a id=tpsetA><img src="images/gear.gifx" title="Change setting for case ' + tpcase + '" /></a></span></div>');
$("#case-div").css('top',Xco + 'px').css('left',Yco + 'px').css('position','absolute').css('visibility','visible'); //.on('click', function() { $("#case-div").hide(700).remove(); } );
$('#tpcm').click( function(){
t4c = $('#' + script + '\\.work_notes').val();
if ( t4c === '' ) { t4c = 'Empty Work Notes field'; }
maildet = maildet + t4c;
tpcase_mailclick(maildet);
console.log('# mail ', casedetails );
});
$('.phncl').click(function() {
var info = $(this).parent().attr("title");
$("#case-div").hide().remove();
phonecall(info);
});
$('.mllnk').click(function() {
$this.href = $this.href + '&body=' + $('#' + script + '\\.comments').val();
var info = $(this).parent().attr("title");
$("#case-div").hide().remove();
vndrmail(info);
});
$('#casedet').click(function() {
show_case_detail(e);
});
$('#tpsetA').click( function() {
tpcase_settings(tpcase,vdr);
});
}, 400);
}
function tpcase_mailclick(mail_det) {
var t = parsevars( mail_det );
window.top.location = t;
}
}, function() {
clearTimeout(case_div_timer);
});
function tpcase_settings(tpcase,vdr){
var casedetails = ['','','',''];
console.log('# tpcase_settings click ',vdr,tpcase);
var pos = $('#case-div').offset();
var Xco = pos.top + 55;
var Yco = pos.left + 90; // ' + vdr + '
$("body").append('<div id="tpcase-set" class="mypopup"> <table style="background-color:transparent;" border=0><tr><td colspan=2>Settings for <b>' + vdr + '</b> case: <b>' + tpcase + '</b></td></tr><tr><td>Contact:</td><td><input size=40></input></td></tr><tr><td>Phone:</td><td><input size=40></input></td></tr><tr><td>Email:</td><td><input size=40></input></td></tr><tr><td>Subject:</td><td><input size=40></input></td></tr><tr><td></td><td><a id=tpcaseok class="mybut" style="float:right;">OK</a> </td></tr></table></div>');
$("#tpcase-set").css('top',Xco + 'px').css('left',Yco + 'px').css('position','absolute').css('visibility','visible'); // .on('click', function() { $("#case-div").hide(700).remove(); }
if ( GM_getValue('tpcase_'+ tpcase ) ) {
console.log('# tpcase_settings click tpcase_' + tpcase + ' exists');
casedetails = GM_getValue('tpcase_'+ tpcase ).split(';');
for (i = 1; i < casedetails.length + 1; i++ ){
$('#tpcase-set > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(' + (i + 1) + ') > td:nth-child(2) > input:nth-child(1)').val( casedetails[i-1] );
console.log('# tpcase_settings ' + casedetails[i-1] );
}
}
$('#tpcaseok').click(function(){
for (i = 1; i < casedetails.length + 1; i++ ){ // #tpcase-set > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > input:nth-child(1)
casedetails[i - 1] = $('#tpcase-set > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(' + (i + 1) + ') > td:nth-child(2) > input:nth-child(1)').val();
console.log('# saving ', casedetails[i - 1] );
}
console.log('# Saving tpcase_'+ tpcase);
GM_setValue('tpcase_'+ tpcase, casedetails.join(';') );
$("#tpcase-set").remove();
$("#case-div").remove();
console.log('# Saved tpcase_'+ tpcase + ' with: ' + casedetails.join(';') );
});
}
}
// data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAADlUlEQVRYhe1Zv2tUWRQeN0oKYVOY0vUHpFBQyHa2wfwHFgsJprC1sQgIFvZuoxuEpLcVktIihbD7D0SIBB4EIxLGQAqnmPfjfN98W3hf9uYxM+/eyZtxl80Htxnu+c43Z86cc++5rdY5zjEZJEkynWXZXJ7nd8uVZdlckiTTP1rbCSRNSVoEsEbyA0lTH5A0kjsA1iQtSpqauNh2u32Z5CrJz/1E1oHkZ5Kr7Xb78kQEA1giedhHCEnuAdgEsGFmrwBsANgiuUeSfWwOASyNTaykGQBvK057ALYBrHQ6nSvD7DudzhUAKwC2SfZ8Hsc706jgNE2vk/xYcfRO0vwofJLmnb0fgI+SrjUp+JNH/g3AchPcAJZJfvO4P6Vpev1MpJJm/AiT3Jd0qwnBno9bjrf0sXumVPFzmOR+t9u92qDeE3S73au+cABvRyICsOynRNMRriLP89t+qkRXFVeHDz2CRnK4DpVAHUbVcZKrfpWIcZym6U2ST8zsd5JP0jS9GSn8nSd8NchI0lTZ6Vw9DSprki6QfF5t5a6FPw8VLWm+rOMkDxTS8vX9bFBGeTvUGcnHzlHXzF4A+M3MXpDsus8fh3IB2Pa+92KIwZoneiXEiaSLJI9chE45MbP7JHskjyRdDBS94mlYqzUg+cFFhnWtuUSe53ecg78GiPhTkvI8vxPCJ2nWS5GdoZuTJJkuc5LkXgD5DTNbAPAAwGuST81sobpIPgXwGsADM1uQdKOOm+Se01FIujBwY5Zlc97PshVAfNIQYkByv44bwKZn8tPAjXme3/VEbwSIPhpR9FGA6PVo0Wb2qo5Y0nuSReyS9L6O28xejiXSAB6a2R+xC8DDAO6wSI+Q0+0R06MdIDosp2OrB8mvI4r+GsAdVj3c5h23ubZOk3wGYCt2kXw2jFcxdbrViuuIAN6Q3I9dAN7U8MZ1REWcPcZV8qLPHoo45ZH8MqLoL4M4i6L4tXLKG/wnrIgJOk8XRXEPwKPYVRTFvUGcI52nW63/6M3FESx5BP/+O2KJCd7Gf2nkNt5q9Z975Hl+u0G9ZYRPzT2Oj49/PhOppGuTnDCpqdGYE77rl60xzPJ2GxPsORo6NZU0W2M/O2xqeuaUGIYh8+ke/5lPr5vZSwDrADb5fT7d62Mz3vm0D+8l4KAqJAQkDzjJlwAfOv3msuOOkf1EFnRvLmZ2X6GteRKQdKnf65akSz9a2zn+N/gbcBlh+GbaNj4AAAAASUVORK5CYII=
// https://secret.eu.didata.com/DisplayImage.ashx?name=Logo
function tab_secret() {
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="secret" class="tab_caption_text" style="padding:4px 1px 4px 1px;"><a class="mybut_" href="https://secret.eu.didata.com?cust=' + CustNM + '" target="_blank">Secret</a></SPAN></span></h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > h3:nth-child(12)' ) );
// <img width=10 src=https://secret.eu.didata.com/DisplayImage.ashx?name=Logo />
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" /><h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="secret" class="tab_caption_text" style=""><a class="mybut_" href="https://secret.eu.didata.com?cust=' + CustNM + '" target="_blank">Secret</a></SPAN></span></h3>').insertBefore( $('div#tabs2_section > img.tab_spacer:nth-child(10)') );
// <img id="secretimg" onerror="tab_hide(\"Secret\");" width=1 src=https://secret.eu.didata.com/DisplayImage.ashx?name=Logo />
}
$('span#secret' ).parent().hover(
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
}
// <img width=40 src=https://secret.eu.didata.com/DisplayImage.ashx?name=Logo />
function tab_moveit() {
console.log('# add moveit');
var subj ='RE: ' + casenr + ' - ' + encodeURIComponent($('#' + script + '\\.short_description').attr('value'));
console.log('# add moveit1');
if (MyFirstName) {
var body = MyDear + '%0D%0A%0D%0APlease upload your big files (>20MB) here.%0D%0A%0D%0APlease send the package to: ' + MyFirstName.toLowerCase() + '.' + MyLastName.toLowerCase() + '@eu.didata.com.' + parsevars(MyMGSbody);
} else { body =''; }
console.log('# add moveit2');
// $('#tabs2_section').append('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="moveit" class="tab_caption_text" style="padding:4px 1px 4px 1px;">MOVEIT: <a class="mybut" href="https://moveit.dimensiondata.com/human.aspx?arg12=secmsgcomposenew&opt01=' + recep + '&[email protected]&arg01=' + subj + '&arg04=' + body+ '" target="_blank">New Package</a></SPAN></span></h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx" />');
console.log('# moveit add tab');
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="moveit" class="tab_caption_text" style="padding:4px 1px 4px 1px;"><a class="mybut_" href="https://moveit.dimensiondata.com/human.aspx?arg12=secmsgcomposenew" target="_blank"> MOVEit</a></SPAN></span></h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > h3:nth-child(12)' ) ); // &opt01=' + recep + '&[email protected]&arg01=' + subj + '&arg04=' + body+ '
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" /><h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="moveit" class="tab_caption_text" style=""><a class="mybut_" href="https://moveit.dimensiondata.com/human.aspx?arg12=secmsgcomposenew" target="_blank"> MOVEit</a></SPAN></span></h3>').insertBefore( $('div#tabs2_section > img.tab_spacer:nth-child(10)') ); // &opt01=' + recep + '&[email protected]&arg01=' + subj + '&arg04=' + body+ '
}
$('span#moveit > a.mybut_').on('click', function() {
var dt = new Date();
GM_setValue('casemoveit', recep + ';' + subj + ';' + body );
GM_setValue('casedt', dt);
});
console.log('# moveit hover');
$('span#moveit' ).parent().hover(
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
console.log('# moveit done');
// <img width=40 src=https://moveit.dimensiondata.com/images/moveit_dmzR_48trans.gif />
}
function tab_webex() {
var subj =encodeURIComponent('RE: ' + casenr + ' - ' + $('#' + script + '\\.short_description').val() );
var body = MyDear + parsevars(MyMGSbody);
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="webex" class="tab_caption_text" style="padding:4px 1px 4px 1px;"><a class="mybut_" href="https://meetings-eu.dimensiondata.com/orion/meeting/schedule?siteurl=meetings-eu&confName=' + subj + '&scheduler-who=' + recep+ '" target="_blank"> Webex<img src=https://cisco.webex.com/mw3100/mywebex/html/img/cisco-webex-meetings.png /> </a></SPAN></span></h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > h3:nth-child(12)' ) );
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" /><h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="webex" class="tab_caption_text" style=""><a class="mybut_" href="https://meetings-eu.dimensiondata.com/orion/meeting/schedule?siteurl=meetings-eu&confName=' + subj + '&scheduler-who=' + recep+ '" target="_blank"> Webex</a></SPAN></span></h3>').insertBefore( $('div#tabs2_section > img.tab_spacer:nth-child(10)') );
}
$('span#webex' ).parent().hover(
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
// <img width=40 src=https://moveit.dimensiondata.com/images/moveit_dmzR_48trans.gif />
}
function tab_scram() {
if ($('#tabs2_section > h3:nth-child(12)').length == 1 ) {
$('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="scram" class="tab_caption_text" style="padding:4px 1px 4px 1px;"><a class="mybut_" href="https://scram.client.eu.didata.local/?cust=' + CustNM + '" target="_blank"> Scram</a></SPAN></span></h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').insertBefore( $('#tabs2_section > h3:nth-child(12)' ) );
} else {
$('<img class="tab_spacer" width="4" height="24" src="images/s.gifx" /><h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0"><SPAN id="scram" class="tab_caption_text" style=""><a class="mybut_" href="https://scram.client.eu.didata.local/?cust=' + CustNM + '" target="_blank"> Scram</a></SPAN></span></h3>').insertBefore( $('div#tabs2_section > img.tab_spacer:nth-child(10)') );
}
$('span#scram' ).parent().hover(
function() { $( this ).addClass( "tabs2_hover" ); } ,
function() { $( this ).removeClass( "tabs2_hover" ); }
);
}
function show_case_detail(e) {
var p = e.target;
var pos = $('#' + p.id).offset();
Xco = pos.top + 20;
Yco = pos.left;
console.log('#=#=#= show_case_detail ' , e , Xco);
}
function scrollIntoView(eleID) {
var e = unsafeWindow.document.getElementById(eleID);
console.log('#=# scrollIntoView ' , e);
if (!!e && e.scrollIntoView) {
e.scrollIntoView();
}
}
function gusertest() {
var uo = unsafeWindow.gsft.getUser();
console.log('#=test1# FullName' , uo.getFullName());
console.log('#=test1# DisplayName' , uo.getDisplayName());
console.log('#=test1# Email' , uo.getEmail());
console.log('#=test1# MobileNumber', uo.getMobileNumber ());
console.log('#=test1# CompanyID' , uo.getCompanyID());
console.log('#=test1# ManagerName' , uo.getManagerName());
console.log('#=test1# UserRoles' , uo.getUserRoles());
unsafeWindow.CustomEvent.observe('user.login', function(user) {
unsafeWindow.showObjectInline( unsafeWindow.gel("gsft_login") );
alert( user.getFullName() );
});
}
function glidetest() {
// alert('test1-click!');
console.log('#=test# glidetest!');
(function() {
var preferences = {};
var properties = {};
// unsafeWindow.GlideManager.init( {preferences: preferences, properties: properties} );
})();
var f = function() {
console.log('#=test# Gstuff function');
if (typeof(unsafeWindow.g_listHandlersLoaded) == 'undefined') {
unsafeWindow.g_listHandlersLoaded = true;
new unsafeWindow.GlideList2NewHandler();
new unsafeWindow.GlideList2ChecksHandler();
new unsafeWindow.GlideList2SecurityHandler();
console.log('#=test# new Gstuff');
addLoadEvent(function() {
unsafeWindow.CustomEvent.observe("toggle.sections", unsafeWindow.GlideList2.toggleAll);
});
}
console.log('#=test# do I get to 785?');
var list = new unsafeWindow.GlideList2('sys_user', 'sys_user', 'u_extension_numberISNOTEMPTY^ORmobile_phoneISNOTEMPTY^ORemailISNOTEMPTY^company=bb988efd0a0a3c780054ed8cfbc9f79e');
list.setListName('sys_user');
list.setFields('name,phone,mobile_phone,user_name');
list.setTitle('Users');
list.setListControlID('bfae77d30a0a3c0850a388367b322f0d');
list.setProperties('H4sIAAAAAAAAAJ2TTU/DMAyG/0qUExyAsml0k9YhTQOExJcQHDhFaeNuEW4yxSmwf4/bdWi7wMapsePXj+2448uvCsUHBLLeZfL8NJECXOGNdfNMvr5cnwzl5WR8Zyk+Bb+EEC2QKFHPiaPP09EoHQxGcu1R8dNnsseWL2pS3qkAZQBaZDKGGqRATqMK1MTiG7QGmry9jd+7GDwqazKZlxrS1PQTneh+kQwH/BkO+xdp3u/1ysR0kiaUVqRqgtC5fDAQ8lUmH59nV8/Tt+XCOyY7XcF2bPCfyjoDLrYFR53jzn20sXG8skGdpYhnUqMOa7ecjEsLaISlpk0IPDZWlBqp6VTngJl8YKwUtGAaWve+mUPUYQ5RlT5U29APjTWnaGqVZ/ukn9ZcExCJrsstUBf4O2kt2wt173OL8F9Q1arVAbxmxOJ2Jo6uTiptUWhjeJPo+HB2Y6jNTJc68Cnyq3YrUXhEKKJtlxV1BKPa4n7kf6neYbV3bEvgAy3s8jBRWxbCjuhs96+cfANQUuiqzAMAAA==');
// pass order by, since it can come from sources other than the query string
list.setOrderBy('ORDERBYphone');
// save the data that we will need to refresh the list
list.setView('');
list.setSubmitValue('sysparm_list_css', '');
list.setSubmitValue('sysparm_target', '');
list.setSubmitValue('sysparm_fixed_query', '');
list.setSubmitValue('sysparm_group_sort', '');
// if rows per page is specified, carry it along
if ('')
list.setSubmitValue('sysparm_rows_per_page', '');
if ('')
list.setSubmitValue('sysparm_nameofstack', '');
list.setReferringURL('sys_user_list.do?sysparm_query=u_extension_numberISNOTEMPTY%5EORmobile_phoneISNOTEMPTY%5EORemailISNOTEMPTY%5Ecompany%3Dbb988efd0a0a3c780054ed8cfbc9f79e');
list.setUserList(true);list.handlePrint(true);list = null;
};
// hierarchical list patch - all lists have to be loaded before the context menus can be built
// this is wokring by trick, not design -- code pre 25 dec 2011 had a similar trick
// better design would be to create the context menus after all the hiererchical lists are loaded
if (typeof unsafeWindow.GlideList2 == "undefined") {
console.log('#=test# addLoadEvent');
unsafeWindow.addLoadEvent(f);
}
else {
console.log('#=test# f.call()');
f.call();
}
}
function test1() {
console.log('#=test1# test1()');
var sections = unsafeWindow.g_form.getSections();
console.log('#=test1# ', sections);
}
function test2() {
console.log('#=test2# ' , $('tr.activity_data:nth-child(' + 326 + ') > td:nth-child(1) > span:nth-child(1) > div:nth-child(1)').html(), $("table[id^='activity_detail']").find('tr').length);
console.log('#=test2# ' , $("label[for='" + script + "\\.comments']").length ) ;
}
function itsm_settings() {
if ($("#itsmset").length > 0) {
$("#itsmset").css('top','100px').css('left','100px').fadeIn(500);
}
else {
var options = GM_getValue('ITSMsettingsOptions1');
if ( typeof options == "undefined" ) { options='email tenplate1\n'; } else { console.log('#=# options via GM getvalue'); }
var actions = GM_getValue('ITSMsettingsActions2');
if ( typeof actions == "undefined" ) {
actions='Hi {fn} {ln},\r\n\r\n\r\n\r\nBest regards\r\n\r\n'; ///.replace(/\n/g,'\\n')
} else { console.log('#=# action via GM_getvalue'); }
var nrs =' ';
for (i = 1; i < 6; i++) {
nrs += i.toString();
if (i < 5) { nrs += '\n '; }
}
$("body").append('<div id="itsmset" style="top:100px;left:100px;" class="mypopup" > \
<form><table id="hopset" border=0 width="100%" class="drghdl1" style="background-color:transparent;"> \
<tr class=set1><td colspan="3" id="itsmdrag" class="draghandle"><a title=""><img src="images/help.gifx" style="float:left;"/></a> settings<a style="float:right;"><span id=close-itsmset class="sprite1 close-button"></span></a></td></tr> \
<tr><td class=tbclk>Action Settings</td><td class=tbclk>Mail Template Settings</td><td class=tbclk>Other Settings</td></tr> \
<tr><td> <input class="ch" type="checkbox" name="ch1" value="valuable" id="ch1"/><label for="ch1"></label></td><td colspan=2>Auto-submit on SWOW update </td></tr><tr> \
<tr><td> <input class="ch" type="checkbox" name="ch2" value="valuable" id="ch2"/><label for="ch2"></label></td><td colspan=2>Auto-submit on reassign to closure Q </td></tr><tr> \
<tr><td>Line</td><td>Option</td><td>Action</td></tr><tr> \
<td><textarea disabled id="ta1" cols=1 rows=5>' + nrs + '</textarea></td>\
<td><textarea id="ta2" cols=24 rows=5>' + options + '</textarea></td>\
<td><textarea id="ta3" cols=60 rows=5>' + actions + '</textarea></td></tr> \
<tr class=set1><td colspan=3><label>Combo box:</label><input id=combo type="text" list="comboid">\
<datalist id="comboid">\
<option value="0">\
<option value="-30">\
<option value="30">\
<option value="+50">\
<option value="patat">\
<option value="tochtgat">\
<option value="zomaar">\
<option value="lorum">\
<option value="ipsem">\
<option value="pater">\
<option value="vadim">\
<option value="l">\
</datalist></td></tr> \
<tr><td colspan=3><meter min=0 max=24 value=12>12 units</meter> <progress id="prog" max=100></progress>\
<span id=flup-itsmset class="sprite1 flup-button"></span></td></tr> \
<tr><td colspan=3><a id="saveset">Save</a> <a id="clsSet">Cancel</a> <a id="resSet" title="\
Reset to default values\nSave SVR before using">Reset</a></td></tr> \
</table></form> \
</div>');
$("#saveset").click(saveset).addClass('mybut');
$("#ta1").addClass('flataera');
$("#ta2").addClass('flataera');
$("#ta3").addClass('flataera');
// $("#close-itsmset").click(closeset);
$("#itsmset").css('position','absolute').css('visibility','visible'); // .udraggable({ handle: '.drghdl1' });
$("#clsSet").click(closeset).addClass('mybut');
$("#resSet").click(resetset).addClass('mybut');
$('#itsmdrag').on('mousedown', function(e) {
console.log('#=#= drag' , $(e.target).closest('div').attr('id') , $(e.target).attr('id') );
if ( $(e.target).attr('id') === 'close-itsmset') {
console.log('# hide cc 1');
$("#itsmset").hide();
} else {
if(e.offsetX==undefined){
xoff = e.pageX-$(this).offset().left;
yoff = e.pageY-$(this).offset().top;
} else {
xoff = e.offsetX;
yoff = e.offsetY;
};
$(this).addClass('draggable');
$body.addClass('noselect');
// $target = $(e.target).parent().parent().parent().parent().parent();
$target = $(e.target).closest('div');
}
});
}
}
function saveset() {
}
function closeset() {
$("#itsmset").hide();
}
function resetset() {
}
function showform() {
if ($("#settings").length > 0) {
$("#settings").css('top','100px').css('left','100px').fadeIn(500);
}
else {
var options = GM_getValue('ITSMsettingsOptions');
if ( !options ) { options=OPT_text.join('\n');} else { console.log('#=# options via GM getvalue'); }
var actions = GM_getValue('ITSMsettingsActions');
if ( !actions ) {
for (i = 0; i < ACT_text.length -1; i++) { ACT_text[ i + 1 ] = ACT_text[ i + 1 ].replace(/\n/g,'\\n'); }
actions=ACT_text.join('\r\n');
} else { console.log('#=# action via GM_getvalue' , actions); }
var nrs =' ';
for (i = 1; i < 41; i++) {
nrs += i.toString();
if (i < 40) { nrs += '\n '; }
if (i < 9) { nrs += ' '; }
}
var options1 = GM_getValue('ITSMsettingsOptions1');
if ( typeof options1 == "undefined" ) {
options1=MailTemplName.join('\n'); } else { console.log('#=# options via GM getvalue');
}
var actions1 = GM_getValue('ITSMsettingsActions2');
if ( typeof actions1 == "undefined" ) {
// actions1='Hi {fn} {ln},\n\n\n\nBest regards\n\n{mf}\n';
for (i = 0; i < MailTemplate.length; i++) { MailTemplate[i] = MailTemplate[i].replace(/\n/g,'\\n'); }
actions1=MailTemplate.join('\r\n');
}
// MailTemplName[2] = 'bye';
// MailTemplate[0] = MyDear + MyMGSbody;
// actions1=actions1.replace(/\n/g,'\\n')
console.log('#=# action1 via GM_getvalue' , actions1 );
var nrs2 =' ';
for (i = 1; i < 8; i++) {
nrs2 += i.toString();
if (i < 9) { nrs2 += '\n '; }
}
$("body").append('<div id="settings" class="mypopup" style="top:100px;left:100px;" > \
<table id="hop" border=0 width="100%" style="background-color:#ccc;"> \
<tr><td id="settingsdrag" colspan="3" class="draghandle"><a style="float:right;" id="clsSettings"><span class="sprite1 close-button"></span></a><a title="\n\
Values between {} are replaced in runtime when inserting the command \n\
{sa} is short Assignee, e.g Kurt Siau becomes kusi \n\
{mf} becomes Kurt, {ml} becomes Siau, {mn} becomes Kurt Siau\n\
{dt} becomes the current date {tm} becomes time in 24h format\n\
{sp=} becomes a separator of ============ \n\
\\n gives a new line \n\
{tm} gives the time\n\
{dt} gives the date time\n\
{case} gives the casenr\n\
{status} gives the casestatus, {eta} gives the case ETA date\n\
{swow} gives the swow update text, and {product}, {serial}, {version} \n\
and {contract} will give the value of the mentioned fields as shown \n\
in the case notes.\n\
See top of the script for more explanation.\n\n"><img src="images/help.gifx" style="float:left;"/></a></td></td></tr> \
<tr><td colspan=3 class=itsmplus valign=bottom style="height:20px;"> <span class="tabs2_tab tabs2_active tbclk"> Action Settings </span> <span class="tabs2_tab tbclk"> Mail Template Settings </span> <span class="tabs2_tab tbclk"> Other Settings </span> </td></tr> \
<form><tr class=set1><td>Line</td><td>Option</td><td>Action</td></tr> \
<tr class=set1><td> <textarea disabled id="ta1" cols=2 rows=40>' + nrs + '</textarea></td>\
<td><textarea id="ta2" cols=24 rows=40>' + options + '</textarea></td>\
<td><textarea id="ta3" cols=160 rows=40>' + actions + '</textarea> </td></tr> \
<tr class=set2><td>Line</td><td>Option</td><td>Action</td></tr> \
<tr class=set2><td> <textarea disabled id="ta4" cols=2 rows=7>' + nrs2 + '</textarea></td>\
<td><textarea id="ta5" cols=24 rows=7 >' + options1 + '</textarea></td>\
<td><textarea id="ta6" cols=160 rows=7 >' + actions1 + '</textarea></td></tr> \
<tr class=set3><td> <input class="ch" type="checkbox" name="ch1" value="valuable" id="ch1"/><label for="ch1"></label></td><td colspan=2>Auto-submit on SWOW update </td></tr><tr> \
<tr class=set3><td> <input class="ch" type="checkbox" name="ch2" value="valuable" id="ch2"/><label for="ch2"></label></td><td colspan=2>Auto-submit on reassign to closure Q </td></tr><tr> \
<tr class=set3><td> </td><td colspan=2> I will indicate when this works :-) </td></tr><tr> \
<tr><td colspan=3 style="height:20px;border-radius:4px;"><a id="saveset">Save</a> <a id="resSetting1" title="\
Reset Actions to default values\nSave SVR before using">Reset Actions</a> <a id="resSetting2" title="Reset Mail templates to default values\nSave SVR before using">Reset Mail Templates</a> </td></tr>\
</table></form> \
</div>');
$("#saveset").click(saveform).addClass('mybut');
$("#ta1").addClass('flataera');
$("#ta2").addClass('flataera');
$("#ta3").addClass('flataera');
$("#ta4").addClass('flataera');
$("#ta5").addClass('flataera');
$("#ta6").addClass('flataera');
$("#settings").css('position','absolute').css('visibility','visible'); //.udraggable({ handle: '.drghdl1' });
$("#clsSettings").click(closeform); //.addClass('mybut')
$("#resSetting1").click(resetform1).addClass('mybut');
$("#resSetting2").click(resetform2).addClass('mybut');
$('#settingsdrag').on('mousedown', function(e) {
// console.log('#=#= drag' , $(e.target).parent().parent().parent().parent().attr('id') );
if(e.offsetX==undefined){
xoff = e.pageX-$(this).offset().left;
yoff = e.pageY-$(this).offset().top;
}else{
xoff = e.offsetX;
yoff = e.offsetY;
};
$(this).addClass('draggable');
$body.addClass('noselect');
$target = $(e.target).parent().parent().parent().parent(); //.parent(); //
});
$('.set2').hide();$('.set3').hide();
$('#resSetting2').hide();
$('.tbclk').click( function(e) {
$('.set1').hide();$('.set2').hide();$('.set3').hide();
$('.tbclk').removeClass('tabs2_active');
$(this).addClass('tabs2_active');
if($(this).text().indexOf('Action') > -1) { $('.set1').show(); $('#resSetting2').hide(); $('#resSetting1').show(); }
if($(this).text().indexOf('Mail') > -1) { $('.set2').show(); $('#resSetting1').hide(); $('#resSetting2').show(); }
if($(this).text().indexOf('Other') > -1) { $('.set3').show(); $('#resSetting2').hide(); $('#resSetting1').hide(); }
});
}
}
function closeform() {
$("#settings").css('top','100px').css('left','100px').fadeOut(500);
}
function resetform1() {
GM_deleteValue('ITSMsettingsOptions');
GM_deleteValue('ITSMsettingsActions');
$("#settings").css('top','100px').css('left','100px').fadeOut(500);
rfsh();
}
function resetform2() {
GM_deleteValue('ITSMsettingsOptions1');
GM_deleteValue('ITSMsettingsActions2');
$("#settings").css('top','100px').css('left','100px').fadeOut(500);
rfsh();
}
function saveform() {
console.log('# saveform ' );
GM_setValue('ITSMsettingsOptions' , $("#ta2").val());
GM_setValue('ITSMsettingsActions' , $("#ta3").val());
GM_setValue('ITSMsettingsOptions1', $("#ta5").val());
GM_setValue('ITSMsettingsActions2', $("#ta6").val());
var jsonActions = [];
jsonActions = $("#ta3").val().split(/\n/g);
GM_setValue("jsonActions", JSON.stringify(jsonActions) );
// var b = JSON.parse(GM_getValue("key"));
MailTemplName = $("#ta5").val().split(/\n/g);
MailTemplate = $("#ta6").val().split(/\n/g);
console.log('# lines in ta6 ' + MailTemplate.length );
for (i = 0; i < MailTemplate.length; i++) { MailTemplate[i] = MailTemplate[i].replace(/\n/g,'\\n'); }
console.log('# line 3 ' + MailTemplate[2] );
// GM_setValue('ITSMsettingsActions2', arta6.join("\n"));
form2options();
$("#settings").css('top','100px').css('left','100px').fadeOut(500);
}
function form2options() {
console.log('#=# ITSMsettingsOptions ');
// GM_deleteValue('ITSMsettingsOptions');
// GM_deleteValue('ITSMsettingsActions');
// console.log('#=# ITSMsettingsActions & ITSMsettingsOptions deleted!!!!!!!');
if ( typeof GM_getValue('ITSMsettingsOptions') !== 'undefined' ) {
console.log('#=# load ITSMsettingsOptions ');
var stoem = GM_getValue('ITSMsettingsOptions');
console.log('#=# ITSMsettingsOptions defined');
if ( stoem.split('\n').length > 10 ) {
var options = GM_getValue('ITSMsettingsOptions');
if ( options ) {
OPT_text = options.split('\n');
console.log('#=# split ITSMsettingsOptions ');
OPT_text.unshift('Action 0'); // need this, because we count from 1 not 0
console.log('#=# shift ITSMsettingsOptions ');
}
}
} else {
console.log('#=# ITSMsettingsOptions undefined' , OPT_text.length);
}
if ( typeof GM_getValue('ITSMsettingsActions') !== 'undefined' ) {
var stoem = GM_getValue('ITSMsettingsActions');
console.log('#=# ITSMsettingsActions' , stoem.split('\n').length );
if ( stoem.split('\n').length > 10 ) {
if ( typeof GM_getValue('ITSMsettingsActions') !== 'undefined' ) {
var actions = GM_getValue('ITSMsettingsActions');
if ( actions ) {
ACT_text = actions.split('\n');
ACT_text.unshift('Action 0');
for (i = 1; i < 41; i++) {
ACT_text[i] = ACT_text[i].replace(/\\n/g,'\n');
}
}
}
}
} else {
console.log('#=# ITSMsettingsActions undefined' , ACT_text.length);
}
// console.log('#=# ITSMsettingsActions()' , stoem );
console.log('#=# form2options() removing current options OPT_text[1]= ' + OPT_text[1] );
$('#wims1').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Your Actions </option>').val(0);
$('#wims2').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Customer Actions </option>').val(0);
$('#wims3').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Vendor Actions </option>').val(0);
$('#wims4').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Other Actions </option>').val(0);
$('#wims5').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Your Actions </option>').val(0);
$('#wims6').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Customer Actions </option>').val(0);
$('#wims7').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Vendor Actions </option>').val(0);
$('#wims8').find('option').remove().end().append('<option style="background-color:#DFF" value= 0> Other Actions </option>').val(0);
for (var i = 1; i < 41; i++) {
if (i < 11) {
$('#wims1').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
// console.log('#=# OPT_text[' + i + ']=' + OPT_text[i]);
$('#wims5').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
} else if ( i < 21 ) {
$('#wims2').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
$('#wims6').append ($('<option></option>').attr('value',i).text(OPT_text[i]) );
} else if ( i < 31 ) {
$('#wims3').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
$('#wims7').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
} else if ( i < 41 ) {
$('#wims4').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
$('#wims8').append( $('<option></option>').attr('value',i).text(OPT_text[i]) );
}
}
if ( typeof GM_getValue('ITSMsettingsOptions1') !== 'undefined' ) {
var options1 = GM_getValue('ITSMsettingsOptions1');
MailTemplName = options1.split('\n');
console.log('#=# ITSMsettingsOptions1 defined' , MailTemplName.length);
}else {
console.log('#=# ITSMsettingsOptions1 undefined' , MailTemplName.length);
}
if ( typeof GM_getValue('ITSMsettingsActions2') !== 'undefined' ) {
var actions2 = GM_getValue('ITSMsettingsActions2');
MailTemplate = actions2.split('\n');
console.log('#=# ITSMsettingsActions2 defined' , MailTemplate.length);
}else {
console.log('#=# ITSMsettingsActions2 undefined' , MailTemplate.length);
}
$('#mailtype').find('option').remove().end().append('mailoptions');
for (var idx = 0, len = MailTemplName.length; idx < len; idx++) {
// mailoptions += '<option style="background-image:url(images/icons/email.gifx);background-repeat:no-repeat;background-position:1px; " title="' + MailTemplName[idx] + '" value="' + idx + '" selected>__ ' + MailTemplName[idx] + '</option>'
$('#mailtype').append( $('<option class="mto" title="' + MailTemplName[idx] + '"></option>').attr('value',idx).text('__ ' + MailTemplName[idx] ) );
}
console.log('#=# ITSMsettingsOptions done. ');
}
function changemailink(idx) {
var t = parsevars( MailTemplate[idx] );
console.log('changemailink update ' + idx + ' ' + t );
window.top.location = tosub + '&body=' + t + mcc;
return false;
}
function parsevars(txt) {
var t = txt.replace(/{fn}/g,custfn).replace(/{ln}/g,custln);
t = t.replace(/{mf}/g,MyFirstName).replace(/{ml}/g,MyLastName).replace(/{mn}/g,Assignee);
t = t.replace(/{product}/g,info[0]).replace(/{serial}/g,info[2]).replace(/{version}/g,info[1]).replace(/{contract}/g,info[3]);
t = t.replace(/{swow}/g,swow);
t = t.replace(/{sp=}/g,sep);
t = t.replace(/\\n/g,'%0A%0D').replace(/\n/g,'%0A%0D'); // below should not contain newlines CRLF
t = t.replace(/{dt}/g,rnow);
t = t.replace(/{sa}/g,shortassign);
t = t.replace(/{company}/g,CustNM);
t = t.replace(/{eta}/g,etadt);
t = t.replace(/{status}/g,prbstat);
t = t.replace(/{case}/g,casenr);
t = t.replace(/{siteid}/g,siteid);
return t;
}
function test3() {
// Initialize the GlideDialog window
console.log('#=test3# test3()');
var w = new unsafeWindow.GlideDialogWindow('sys_user');
w.setSize(750,300);
w.setTitle('show sys_user_list');
w.setPreference('table', 'sys_user');
w.setPreference('sysparm_view', 'sys_user_list');
// Set the query for the list
var customer = 'bb988efd0a0a3c780054ed8cfbc9f79e';
var query = 'u_extension_numberISNOTEMPTY%5EORmobile_phoneISNOTEMPTY%5EORemailISNOTEMPTY%5Ecompany%3D' + customer;
w.setPreference('sysparm_query', query);
// Open the popup
console.log('#=test3# render()');
w.render();
// w.setFields('name,phone,mobile_phone,user_name');
// w.setPreference('Fields', 'name,phone,mobile_phone,user_name');
// w.setPreference('ReferringURL', 'sys_user_list.do?sysparm_query=u_extension_numberISNOTEMPTY%5EORmobile_phoneISNOTEMPTY%5EORemailISNOTEMPTY%5Ecompany%3Dbb988efd0a0a3c780054ed8cfbc9f79e');
}
function rfsh() {
location.reload();
}
function test4() {
var url = 'sys_user' + 'list.do?';
var customer = 'bb988efd0a0a3c780054ed8cfbc9f79e';
var query = 'sysparm_query=u_extension_numberISNOTEMPTY^ORmobile_phoneISNOTEMPTY^ORemailISNOTEMPTY^company=' + customer;
url += query;
var w = unsafeWindow.getTopWindow();
w.popupOpenFocus(url, 'related_list', 950, 700, '', false, false);
}
function find_refs_in_request_log() {
var p = $('span.tabs2_section_3').length;
if (p > 0) {
console.log('#=# ', $('span.tabs2_section_3').attr('tab_caption_raw') );
var z = $('span.tabs2_section_3').html();
p = 0;
while ( z.indexOf('Ref:',p) > 0 ) {
p = z.indexOf('Ref:',p);
console.log('#=# ', z.substr(p, 18) );
p = p + 10;
}
}
}
//
// CustomEvent.observe('user.logout', function() { hideObject(gel("gsft_login")); });
//
// CustomEvent.observe('user.login', function(user) {
// showObjectInline(gel("gsft_login"));
// inner('gsft_full_name', htmlEscape(user.getFullName()));
// }); ^
// |
// \____ span id
// var gr = new GlideRecord("sys_user");
// gr.query();
// while(gr.next()) {
// if (gr.accumulated_roles.toString().indexOf(",self_service,") == -1) {
// gr.roles = gr.roles + ",self_service";
// gr.update();
// }
// }
// div tabs2_section
// <h3 class="tab_header">
// <span class="tabs2_tab" tabindex="0">
// <span style="margin-right: 2px; background-color: #00FF00;">
// <img src="images/s.gifx" alt="" style="width: 4px; height: 12px; margin: 0px;"></img>
// </span>
// <span class="tab_caption_text">
// My Tab!!
// </span>
// </span>
// </h3>
function swowhilite() {
var f = 0;
var p = 3;
var sd = script.toUpperCase().replace('U_','') + ' DESCRIPTION';
console.log('# SWOW ', sd);
$('#element\\.' + script + '\\.comments\\.additional > span:nth-child(1) > div:nth-child(1) > div:contains("' + sd + '")').each( function() {
if ( $(this).find('span > span').text().toUpperCase().indexOf('ACTION PLAN') > 0 ) {
$(this).toggleClass('swowhilite');
f++;
}
});
// obj.parent().parent().toggleClass('swowhilite');
if ( f == 0 && $('#sys_display\\.' + script + '\\.assignment_group').val() === 'EU.BE.TechSupport' && $('#sys_display\\.' + script + '\\.assigned_to').val() !== '') {
$('#myinfo_box').text( ' Add a SWOW Update!!! ' ).addClass('info_box').css('display','block');
alert('noSWOW');
}
console.log('# SWOW entries found ', f );
}
function swowhilitelog() {
var f = 0;
var sd = script.toUpperCase().replace('U_','') + ' DESCRIPTION';
$('ul#activity-stream-unordered-list-entries').find('li > div:nth-child(1) > div:nth-child(3) > div:nth-child(1) > span:nth-child(1)').each( function() { // :contains("' + sd + '")
if ( $(this).text().toUpperCase().indexOf('ACTION PLAN') > 0 ) {
$(this).toggleClass('swowhilite');
$(this).prev().toggleClass('swowhilite');
f++;
}
});
console.log('# SWOW LOG entries found ', f );
}
// li.h-card:nth-child(11) > div:nth-child(1) > div:nth-child(3) > div:nth-child(1) > span:nth-child(1)
function hide_stuff(p) {
if ( p == 1 ) {
// $('#banner_top_left').css('display','none');
// $('#mainBannerImage').css('display','none');
$('#element\\.' + script + '\\.approval').css('display','none');
$('#element\\.' + script + '\\.u_workflow_stage').css('display','none');
$('#element\\.' + script + '\\.u_responsible_owner_group').css('display','none');
$('#element\\.' + script + '\\.u_responsible_owner').css('display','none');
$('tr.annotation-row:nth-child(19) > td:nth-child(1)').css('display','none');
$('#element\\.' + script + '\\.contact_type').css('display','none');
$('#element\\.' + script + '\\.u_classification\\.u_classification_path').css('display','none');
$('#element\\.' + script + '\\.u_equipment_requirements').css('display','none');
$('#element\\.' + script + '\\.u_knowledge_article').css('display','none');
$('#element\\.' + script + '\\.u_major_task').css('display','none');
$('#element\\.' + script + '\\.u_is_critical').css('display','none');
$('#element\\.' + script + '\\.priority').css('display','none');
} else {
// $('#banner_top_left').css('display','inline');
// $('#mainBannerImage').css('display','inline');
$('#element\\.' + script + '\\.approval').css('display','inline');
$('#element\\.' + script + '\\.u_workflow_stage').css('display','inline');
$('#element\\.' + script + '\\.u_responsible_owner_group').css('display','inline');
$('#element\\.' + script + '\\.u_responsible_owner').css('display','inline');
$('tr.annotation-row:nth-child(19) > td:nth-child(1)').css('display','block');
$('#element\\.' + script + '\\.contact_type').css('display','inline');
$('#element\\.' + script + '\\.u_classification\\.u_classification_path').css('display','inline');
$('#element\\.' + script + '\\.u_equipment_requirements').css('display','inline');
$('#element\\.' + script + '\\.u_knowledge_article').css('display','inline');
$('#element\\.' + script + '\\.u_major_task').css('display','inline');
$('#element\\.' + script + '\\.u_is_critical').css('display','inline');
$('#element\\.' + script + '\\.priority').css('display','inline');
}
}
function wiva_on_off() {
console.log('#=#=#=# Toggle wiva buttons');
if ( GM_getValue('wivastate') === 'on' ) {
$('#wiva').css('display','none');
$('#wivaimg').attr('src','images/activity_filter_on.gifx');
$('#wiva2').css('display','none');
$('#wivaimg2').attr('src','images/activity_filter_on.gifx');
GM_setValue('wivastate','off');
console.log("#=#=#=# wiva buttons hide ", $('#wivaimg').attr('src') );
} else {
$('#wiva').css('display','inline');
$('#wivaimg').attr('src','images/activity_filter_off.gifx');
$('#wiva2').css('display','inline');
$('#wivaimg2').attr('src','images/activity_filter_off.gifx');
GM_setValue('wivastate','on');
console.log("#=#=#=# wiva buttons show ", $('#wivaimg').attr('src') );
}
}
// $('#wiva').toggle(); .css('display','none'); .css('display','inline');
function myalert(txt) {
console.log('#=#=#=# myalert called');
$('span#anotif').before('<span id="toplrt" class="redalert" ><img src="/images/arrows_expand_sm.gifx" title="' + txt.replace(/<p>/ig,'\n').replace(/<br>/ig,'\n').replace(/<hr>/ig,'\n____________________________\n') + '"/></span>').text(' ' + txt + ' ');
setTimeout(function(){ clearmyalert(); }, 700);
$('#alarmmsg').html(txt);
// setTimeout(function(){ $('span#anotif').html(' ' + txt + ' ').css('padding','2px 7px 2px 7px'); }, 1400);
// setTimeout(function(){ clearmyalert(); }, 2100);
// setTimeout(function(){ $('span#anotif').html(' ' + txt + ' ').css('padding','2px 7px 2px 7px'); }, 2800);
// setTimeout(function(){ clearmyalert(); }, 3500);
// setTimeout(function(){ $('span#anotif').html(' ' + txt + ' ').css('padding','2px 7px 2px 7px'); }, 4200);
// setTimeout(function(){ clearmyalert(); }, 5000);
}
function clearmyalert() {
$('span#anotif').html('').css('padding','0px');
}
function replacer(t) {
// var eta GM_getValue(casenr + '_ETA');
t = t.replace('{dt}',rnow).replace('{sa}',shortassign).replace('{sp=}',sep1).replace('{sp/}',sep2).replace('{tm}',rtime).replace('{fn}',custfn).replace('{ln}',custln).replace(/{mf}/g,MyFirstName).replace(/{ml}/g,MyLastName).replace(/{mn}/g,Assignee);
t = t.replace(/{case}/g,casenr).replace(/{eta}/g,etadt);
return t;
}
// MAIN
timer5 = new Date();
console.log('#=#=#=# starting Aloop 0');
var itsmversion = $('#mainBannerImage',unsafeWindow.parent.document).attr('title');
var loggedin = $('#gsft_full_name',unsafeWindow.parent.document).text();
if ( GM_getValue('loggedin') ) { loggedin = GM_getValue('loggedin'); }
var Assignee = '';
if ( unsafeWindow.g_form.getValue('sys_display.' + script + '.assigned_to') !== undefined ) {
Assignee = unsafeWindow.g_form.getValue('sys_display.' + script + '.assigned_to');
}
if ( loggedin === 'undefined' || loggedin === '') { loggedin = Assignee;}
var shortassign = loggedin.split(' ')[0].substring(0,2) + loggedin.split(' ')[1].substring(0,2);
shortassign = shortassign.toLowerCase();
console.log('#=#=#=# loggedin='+ loggedin + ' === '+ ( GM_getValue('loggedin') ? GM_getValue('loggedin') : 'unknown ' ) + ' Assignee=' + Assignee );
var Z;
if ( script == 'u_request' ) { Z = ' REQUEST'; } else if ( script == 'incident' ) { Z = ' INCIDENT'; } else if ( script == 'problem' ) { Z = ' PROBLEM'; } else if ( script == 'u_rim_event' ) { Z = ' EVENT'; } else { Z = ' CHANGE'; }
var btcol = 'normalbg';
console.log('#=#=#=# starting Aloop 1');
// remove unused greyed-out fields
// $('#header_attachment_line').next().next().next().find('tr.annotation-row').css('display','none');
// #\39 7a49b36a84ba1b700b53a0e75e54b54 > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1)
// #\39 7a49b36a84ba1b700b53a0e75e54b54 > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1)
// #\39 7a49b36a84ba1b700b53a0e75e54b54 > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(2) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(24)
// .info_box > img:nth-child(1)
// images/error_tsk.gifx
// images/info_tsk.gifx
// class="info_box"
// $('div.info_box:contains("PLEASE NOTE THAT")').css('display','none');
// $('div.info_box:contains("PLEASE NOTE THAT")').find('img').remove();
// $('div.info_box:contains("PLEASE NOTE THAT")').removeClass('info_box').text('').attr('id','myinfo_box').find('img').remove().append('<span id="myinfo_box"></span>');
// $('div.info_box:contains("PLEASE NOTE THAT")').parent().parent().remove().append('<tr><td colspan=2><table style="width:100%;"><tr><td colspan=2><span id="myinfo_box" style="white-space: nowrap;display:none;"></span></td></tr></table><table style="width:100%;"><tr id=l0 class=mytr><td colspan=2></td></tr></table>').parent().parent().css('border-spacing','0px').css('border-collapse','collapse');
$('div#element\\.' + script + '\\.u_effort').after('<div class="form-group"><table style="width:100%;border-collapse:initial;border-spacing:2px;"><tr id=l0 class=mytr><td colspan=2><span id="myinfo_box" style="white-space: nowrap;display:none;"></span></td></tr></table></div>').parent().parent().css('border-spacing','0px').css('border-collapse','collapse');
// $('div.fieldmsg:contains("PLEASE NOTE THAT")').hide();
// $('#banner_top_left').css('display','none');
// $('#mainBannerImage').css('display','none');
// $('#element\\.' + script + '\\.approval').css('display','none');
// $('#element\\.' + script + '\\.u_workflow_stage').css('display','none');
// $('#element\\.' + script + '\\.u_responsible_owner_group').css('display','none');
// $('#element\\.' + script + '\\.u_responsible_owner').css('display','none');
// $('tr.annotation-row:nth-child(19) > td:nth-child(1)').css('display','none');
// $('#element\\.' + script + '\\.contact_type').css('display','none');
// $('#element\\.' + script + '\\.u_classification\\.u_classification_path').css('display','none');
// $('#element\\.' + script + '\\.u_equipment_requirements').css('display','none');
// $('#element\\.' + script + '\\.u_knowledge_article').css('display','none');
// $('#element\\.' + script + '\\.u_major_task').css('display','none');
// $('#element\\.' + script + '\\.u_is_critical').css('display','none');
// $('#element\\.' + script + '\\.priority').css('display','none');
if ( GM_getValue('hidestuff') != 0 ) { hide_stuff(1); }
// remove unused greyed-out fields closure details
$('#element\\.' + script + '\\.u_breached').css('display','none');
$('#element\\.' + script + '\\.u_billable').css('display','none');
$('#element\\.' + script + '\\.knowledge').css('display','none');
// $('#element\\.' + script + '\\.u_technology').css('display','none');
$('#element\\.' + script + '\\.u_auto_close_milestone').css('display','none');
$('#element\\.' + script + '\\.u_ac_confirmation_date').css('display','none');
// $('#element\\.' + script + '\\.u_acceptance_expiry_time').css('display','none');
$('#u_kb_annotation').parent().css('display','none'); // if empty, hide
$('#u_execution_model_annotation').parent().css('display','none'); //
$('#element\\.' + script + '\\.short_description').prev().css('display','none');
// hide silly closed case labels
$('#label\\.' + script + '\\.u_banner').parent().css('display','none');
$('#sys_readonly\\.' + script + '\\.u_banner > font:nth-child(2)').attr('size',1).parent().addClass('info_box');
$('#sys_readonly\\.' + script + '\\.u_banner > font:nth-child(2) > br:nth-child(1)').remove();
// I hate it when I cannot select and copy text! Not gonna retype it motherf*ckers
$('input').removeAttr('disabled').removeClass('disabled');
//
//
$('#sys_readonly\\.' + script + '\\.number').css('background','transparent').css('color','#000');
$('#' + script + '\\.short_description').css('background','transparent').css('color','#000');
var screenwidth = $('#element\\.' + script + '\\.short_description').css('width');
// GM_addStyle(' .wide { width:98% !important; ' );
// GM_addStyle(' .screenwide { width:'+ screenwidth +'px !important; } ')
// $('#element\\.' + script + '\\.comments').css('width',screenwidth).addClass('screenwide');
// $('#element\\.' + script + '\\.comments').parent().parent().removeClass('wide');
$('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(1)').parent().find('table.vsplit_bottom_margin').css('background-color','transparent'); // .css('width','50%')
$('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(2)').parent().find('table.vsplit_bottom_margin').css('background-color','transparent'); // .css('width','50%')
// $('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(1)').css('background-position','right top' ).css('background-repeat','no-repeat').css('background-image','url(https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg)');
// $('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(2)').css('background-position','right bottom').css('background-repeat','no-repeat').css('background-image','url(https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg)');
// $('div.info_box').css('background-color','transparent').css('width','60%');
// $('tr#element\\.'+ script +'\\.u_contract').next().attr('id','tr_hop').find('td').attr('colspan','').css('width','350');
// https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg
$('tr#element\\.' + script + '\\.u_contract_stakeholder\\.u_stakeholder_contact_1').before('<tr class="redalert"><td align=right>Find SDM / AM on sharepoint: </td><td> <a href=http://eubebrusvsps1.eu.didata.local/Lists/Customers/AllItems.aspx?View={284B3398-8B63-4D62-BEC1-620D0B0DB8AD}&Filter=1&FilterValue1=' + CustNM + ' target=_blank><b>eubebrusvsps1</b></a> or on <a href=http://wired.dimensiondata.com/communities/eu/be.belgium/Lists/ClientGroup/All.aspx?Filter=1&View={85DC8EAC-55FA-46B8-A9CB-CD9113FC4F30}&FilterValue1=' + CustNM + ' target=_blank ><b>Wired</b></a></td></tr>');
// console.log('#=#=#<h3 class="tab_header">' + $( 'div#tabs2_section > .tab_header:nth-child(8)').html() + $('div#tabs2_section > .tab_header:nth-child(8)').next().html() );
// console.log('#=#=#</h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx"></img>');
console.log('#=#=# anchors');
var planning_tab = $('#tabs2_section > span:nth-child(11) > span:nth-child(1)'); // new planning_tab
if ( planning_tab.length == 0 ) { planning_tab = $('#tabs2_section > h3:nth-child(12) > span:nth-child(1)') } // old
console.log('#=#=# anchor planning_tab exists', planning_tab.length );
var company_anchor = $('#element\\.' + script + '\\.company > div:nth-child(3) > span'); // new company_anchor
if ( company_anchor.length == 0 ) { company_anchor = $('#' + script + '\\.company') } // old
var requester_anchor = $('#element\\.' + script + '\\.u_caller > div:nth-child(3) > span'); // new requester_anchor
if ( requester_anchor.length == 0 ) { requester_anchor = $('#lookup\\.' + script + '\\.u_caller').closest('td').find('span.ref_contributions'); } // old
requester_anchor.append(' <span id="rq-lst" class="itsmplus"></span>'); //.attr('id','rqlst')
var affected_anchor = $('#element\\.' + script + '\\.u_requested_for > div:nth-child(3) > span'); // new affected_anchor
if ( affected_anchor.length == 0 ) { affected_anchor = $('#lookup\\.' + script + '\\.u_requested_for').closest('td').find('span.ref_contributions'); } // old
affected_anchor.append(' <span id="ac-lst" class="itsmplus" style="display:none;"></span>'); //.attr('id','aclst')
var contract_anchor = $('#element\\.' + script + '\\.u_contract > div:nth-child(3) > span'); // new contract_anchor
if ( contract_anchor.length == 0 ) { contract_anchor = $('#lookup\\.' + script + '\\.u_contract').closest('td').find('span.ref_contributions'); } // old
contract_anchor.attr('id','infoboxlst').append('<span id="ct-lst" class="itsmplus" style="display:none;"></span>');
// #element\.incident\.u_contract > td:nth-child(2) > span:nth-child(2)
var ci_anchor = $('#element\\.' + script + '\\.u_contract_ci > div:nth-child(3) > span'); // new contract_anchor
if ( ci_anchor.length == 0 ) { contract_anchor = $('#lookup\\.' + script + '\\.u_contract_ci').closest('td').find('span.ref_contributions'); } // old
ci_anchor.attr('id','cilst').append('<span id="ci-lst" class="itsmplus" style="display:none;"></span>');
var workload_anchor = $('td.aggregate_measure:nth-child(10) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)'); // new workload_anchor
console.log('##==#=# workload_anchor ' + workload_anchor.text() );
if ( workload_anchor.text() === '' ) { workload_anchor = $('table#' + script + '\\.task_time_worked\\.task_table > tbody:nth-child(2) > tr.aggregate > td.aggregate_measure:nth-child(9) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)'); }
console.log('##==#=# workload_anchor ' + workload_anchor.text() );
var assgrp_anchor = $('#element\\.' + script + '\\.assignment_group > div:nth-child(3) > span'); // new assgroup
if ( assgrp_anchor.length == 0 ) { affected_anchor = $('#lookup\\.' + script + '\\.assignment_group').closest('td').find('span.ref_contributions'); } // old
assgrp_anchor.append(' <span id="ag-lst" class="itsmplus" style="display:inline;"></span>');
var accown_anchor = $('#element\\.' + script + '\\.u_owner > div:nth-child(3) > span'); // new acc owner
if ( accown_anchor.length == 0 ) { affected_anchor = $('#lookup\\.' + script + '\\.u_owner').closest('td').find('span.ref_contributions'); } // old
accown_anchor.append(' <span id="ao-lst" class="itsmplus" style="display:none;"></span>');
if ( $('#myinfo_box').length == 0 ) { $('#element\\.' + script + '\\.u_effort').parent().append(' \
<tr><td colspan=2><table style="width:100%;"><tr><td colspan=2><span id="myinfo_box" style="white-space: nowrap;display:none;"></span></td></tr></table></tr> \
<tr><td colspan=2><table style="width:100%;"><tr id=l0 class=mytr><td colspan=2> </td></tr></table></td></tr>'); } // new timeworked_anchor
var timeworked_anchor = $('#myinfo_box'); // old
var wl_contr = $('#sys_display\\.' + script + '\\.u_contract').attr('value');
if (wl_contr === 'Uptime Configuration MACD') {
$('#element\\.' + script + '\\.u_task_resolution_code').parent().parent().parent().next().css('vertical-align','bottom').html(' If the task charge fields below are empty you have not yet entered time.<br> 15 minutes per unit.');
}
// #\38 794b1770a0a3c080b298efbacdc54f7 > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(4) > td:nth-child(2)
// element.u_request.u_acceptance_expiry_time
var timeworked = workload_anchor.text();
var remarks = '';
console.log('##==#=# timeworked ' + timeworked );
// timeworked_anchor.html('<p class=mylbl>Total workload:</p><p class="myspc"></p><p class=myfld>' + timeworked + '</p>' + remarks).css('display','block'); //.addClass('info_box');
$('#l0').html('<td class=mylbl>Total workload:</td><td class="myspc"></td><td class=myfld>' + timeworked + '</td>' ); //.addClass('info_box');
// $('#myinfo_box').text('Total workload:' + timeworked + ' ' + remarks).css('display','block'); //.addClass('info_box');
var CustID = $('#' + script + '\\.company').val();
CustNM = $('#' + script + '\\.company_label').val();
var cases4cust = '<a title="Show cases for ' + CustNM + '" href="/task_list.do?sysparm_query=company%3D' + CustID + '&sysparm_view=" target="_blank"><img src=images/green_back.gifx style="width:14px;height:14px;" id="showcompcase" /></a>';
var cis4cust = '<a title="Show CI\'s for ' + CustNM + '" href="/cmdb_ci_list.do?sysparm_query=company%3D' + CustID + '&sysparm_view=" target="_blank"><img src=images/timer_start.gifx style="width:14px;height:14px;" id="showcis" /></a>';
var softcis4cust = '<a title="Show Software CI\'s for ' + CustNM + '\nedit url for company=vendor" href="/cmdb_ci_spkg_list.do?sysparm_query=company%3D' + CustID + '^manufacturerLIKEcisco^ORmanufacturerLIKEemc&sysparm_view=" target="_blank"><img src=images/timer_stop.gifx style="width:14px;height:14px;" id="showcis" /></a>';
// var con2shapoi = '<a title="Look for ' + CustNM + ' on sharepoint" href="http://wired.dimensiondata.com/communities/eu/be.belgium/Lists/Cust/Summary.aspx?FilterField1=Customer_x0020_Group0&FilterValue1=' + encodeURIComponent(CustNM) + '" target="_blank"><img src=http://www.easyicon.net/api/resizeApi.php?id=1113662&size=16 id="shapoi" /></a>';
var con2shapoi = '<a title="Look for ' + CustNM + ' on sharepoint\n(This only work when ITSM and sharepoint use the same customer name :-( )" href="http://wired.dimensiondata.com/communities/eu/be.belgium/Lists/Cust/Summary.aspx?FilterField1=Customer_x0020_Group0&FilterValue1=' + encodeURI(ShPoName(CustNM).toUpperCase()) + '" target="_blank"><img class=i16x16 src=' + GM_getResourceURL("sharepicon") + ' id="shapoi" /></a>';
// &FilterField1=Customer_x0020_Group0&SortField=Customer_x0020_Group0&SortDir=Asc&Filter=1
var con2nocfor = '<a title="NOC Forum" href="http://eubebruphpbb/phpbb3_1/viewforum.php?f=177&look4=' + encodeURI(CustNM.replace('/','-')) + '" target="_blank"><img class=i16x16 src=' + GM_getResourceURL("phpbbsicon") + ' id="nocfor" /></a>';
// https://dimensiondataservices.service-now.com/cmdb_ci_list.do?sysparm_query=company%3Df91c95056fe3e900435c81dc5d3ee4f3&sysparm_view=
company_anchor.after('<span class="itsmplus">' + cases4cust + cis4cust + softcis4cust + con2shapoi + con2nocfor + '</span>'); // .css('cursor','pointer')
if ( Assignee === '' ) {
if ( $('#' + script + '\\.company_label').val() === 'ACV/CSC') {
var xx = $('#' + script + '\\.short_description').val().replace(/__/g," ").replace(/_/g," ");
console.log('##==#=# ACV/CSC ' + xx );
$('#' + script + '\\.short_description').val(xx);
}
if ( $('#' + script + '\\.company_label').val() === 'Ineos Manufacturing') {
var xx = $('#' + script + '\\.short_description').val().replace(/\[/g,"").replace(/\]/g,"");
console.log('##==#=# Ineos ' + xx );
$('#' + script + '\\.short_description').val(xx);
}
if ( $('#' + script + '\\.company_label').val() === 'BASE Company') {
var xx = $('#' + script + '\\.short_description').val().replace(/\\'/g,"");
console.log('##==#=# BASE ' + xx );
$('#' + script + '\\.short_description').val(xx);
}
if ( $('#' + script + '\\.company_label').val() === 'Samsonite') {
$('#' + script + '\\.short_description').val( $('#' + script + '\\.short_description').val().replace(/__/g," ").replace(/_/g," ") );
}
}
console.log('# going 1' );
// https://dimensiondataservices.service-now.comhttps://dimensiondataservices.service-now.com/task_list.do?sysparm_query=active%3Dfalse^assigned_to%3Dcacaedfc0a0a3c080179d8df6be90416^ORu_resolved_by%3Dcacaedfc0a0a3c080179d8df6be90416^company%3D86da25c96fe3e900435c81dc5d3ee45d&sysparm_view=assigned_to%3Dcacaedfc0a0a3c080179d8df6be90416^ORu_resolved_by%3Dcacaedfc0a0a3c080179d8df6be90416^company%3D86da25c96fe3e900435c81dc5d3ee45d&sysparm_view=
// $('#tabs2_spacer').css('height','auto');
console.log('# going 1' , $("table[id^='activity_detail']").length );
if ( $("table[id^='activity_detail']").attr('id') ) { var activity = $("table[id^='activity_detail']").attr('id').split('.')[1] } else { activity = 'nix';}
var p = 0;
var caseref = '';
var workloadTabEditing = false;
var workloadTableEdit = false;
var ClosingCase = false;
var niettevaak1 = '';
var niettevaak2 = '';
var rmalinks ='';
console.log('# going 2' );
// while (caseref == '') {
// activity = 'activity_' + activity + '\\.' + p + '_div';
// while ( $('span#' + activity ).find('div:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) img:nth-child(2)').length == 0 ) {
// p++;
// activity = 'activity_' + activity + '\\.' + p + '_div';
// }
// varurl4ref = 'email_display.do?email_id=' + $('span#' + activity ).find('div:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) img:nth-child(2)').attr('id').split('.')[0];
//// $.get( varurl4ref, function( data ) {
//// if ( data.indexOf('Ref:') > 0 ) {
//// caseref = data.substr(data.indexOf('Ref:'), 18) ;
//// if ( caseref.indexOf('<') > 0 ) { caseref = caseref.substr(0, caseref.indexOf('<') ); }
//// var t = $('#n_email').attr('href');
//// if ( t.indexOf('Ref:') < 0 ) {
//// $('#n_email').attr('href', t.substr(0,t.indexOf('&CC=')-1 ) + caseref + t.substr(t.indexOf('&CC='))); // Adjust the link
//// }
//// }
//// console.log( "#=#= Ref " + caseref + ' activity= ' + activity );
//// });
//
// }
console.log('#=test2# ' , $("label[for='" + script + "\\.comments']").length ) ;
console.log('#=#=#=# starting Aloop 2');
// GM_deleteValue('hidelistSVR17634170');
var hidelist = [];
var t = GM_getValue('hidelist'+casenr,'');
if ( typeof t !== undefined ) {
console.log('#=#=# ' + typeof t );
hidelist = t.split(',');
}
var lastMutob = '';
var observer = new MutationObserver( function(mutations) {
mutations.forEach(function(mutation) {
var str = 'MutObSrvr ' + mutation.type + ' attrN ' + mutation.attributeName + ' attrNs ' + mutation.attributeNamespace + ' trgt ' + mutation.target.toString() + ' oldvalue ' + mutation.oldValue;
str = str + '#=#=MutObSrvr Target [' + hop( mutation.target ).replace(/\n/g,'] [');
console.log(str + ']');
if ( str !== lastMutob ){
if ( mutation.target.nodeName === 'SPAN') {
if ( niettevaak1 === '') {
console.log('#=#= closure det.');
mandatory_fields();
niettevaak1 = '!';
var myVar = setInterval(function () { niettevaak1 = ''; }, 500);
}
}
// row_u_request.task_time_worked.task_
if ( mutation.target.nodeName === 'TD' && mutation.target.toString().indexOf('HTMLTableCellElement') > -1 ) { //mutation.target.id.indexOf('row_' + script + '.task_time_worked.task') > -1 &&
console.log('#=#= worload. HTMLTableCellElement');
if ( niettevaak2 < 3) {
console.log('#=#= worload.');
mandatory_fields();
niettevaak2++ ;
var myVar = setInterval(function () { niettevaak2--; }, 1500);
} else{
console.log('#=#= worload. HTMLTableCellElement skiped');
}
}
// if ( mutation.target.nodeName === 'INPUT' && mutation.target.toString().indexOf('HTMLTableCellElement') > -1 ) {
// }
// sys_display.u_request.u_classification
if ( mutation.target.id === script +'.u_redirect_comments' ) {
dingdong2();
}
}
lastMutob = str;
var myVar = setInterval(function () { lastMutob = ''; }, 1000);
});
});
console.log('#=#=MutObSrvr ' + $('#sys_original\\.' + script + '\\.u_accepted').val() );
if ( $('#sys_original\\.' + script + '\\.u_accepted').val() == 0 ) {
var obstarget = document.querySelector( '#' + script + '\\.u_redirect_comments');
var obsconfig = { attributes: true, childList: true, characterData: true, subtree: true };
observer.observe(obstarget, obsconfig);
}
var divcount;
$(document).bind('DOMSubtreeModified',function() {
if ($('div').length !== divcount) {
divcount = $('div').length;
console.log("#=# now there are " + divcount + " divs on this page.");
if ( ClosingCase ) {
if ( $('div#cell_edit_window').length > 0 ) {
workloadTableEdit=true;
}
if ( Boolean(workloadTableEdit) && $('div#cell_edit_window').length == 0 ) {
console.log('#=# workloadTable Edited!');
workloadTableEdit=false;
mandatory_fields();
}
}
if ( $('#current_attachments').length > 0 ) { bingo(); }
if ( $('#current_attachments').length === 0 ) { bingodone = ''; }
if ( $('#sys_user').length > 0 ) { console.log('#=# calling colorphns'); colourphnnrs(); }
}
});
// calendar stuff
g_l=[];g_l.MONTHS=["Janaury","February","March","April","May","June","July","August","September","October","November","December"];g_l.DAYS_3=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];g_l.MONTH_FWD="Move a month forward";g_l.MONTH_BCK="Move a month backward";g_l.YEAR_FWD="Move a year forward";g_l.YEAR_BCK="Move a year backward";g_l.CLOSE="Close the calendar";g_l.ERROR_2=g_l.ERROR_1="Date object invalid!";g_l.ERROR_4=g_l.ERROR_3="Target invalid";g_jsDatePickImagePath="img/";g_jsDatePickDirectionality="ltr";g_arrayOfUsedJsDatePickCalsGlobalNumbers=[];g_arrayOfUsedJsDatePickCals=[];g_currentDateObject={};g_currentDateObject.dateObject=new Date();g_currentDateObject.day=g_currentDateObject.dateObject.getDate();g_currentDateObject.month=g_currentDateObject.dateObject.getMonth()+1;g_currentDateObject.year=g_currentDateObject.dateObject.getFullYear();JsgetElem=function(a){return document.getElementById(a)};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};String.prototype.strpad=function(){return(!isNaN(this)&&this.toString().length==1)?"0"+this:this};JsDatePick=function(a){if(document.all){this.isie=true;this.iever=JsDatePick.getInternetExplorerVersion()}else{this.isie=false}this.oConfiguration={};this.oCurrentDay=g_currentDateObject;this.monthsTextualRepresentation=g_l.MONTHS;this.lastPostedDay=null;this.initialZIndex=2;this.globalNumber=this.getUnUsedGlobalNumber();g_arrayOfUsedJsDatePickCals[this.globalNumber]=this;this.setConfiguration(a);this.makeCalendar()};JsDatePick.getCalInstanceById=function(a){return g_arrayOfUsedJsDatePickCals[parseInt(a,10)]};JsDatePick.getInternetExplorerVersion=function(){var c=-1,a,b;if(navigator.appName=="Microsoft Internet Explorer"){a=navigator.userAgent;b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(b.exec(a)!=null){c=parseFloat(RegExp.$1)}return c}};JsDatePick.prototype.setC=function(a,b){if(this.isie&&this.iever>7){a.setAttribute("class",b)}else{a.className=b}};JsDatePick.prototype.getUnUsedGlobalNumber=function(){var a=Math.floor(Math.random()*1000);while(!this.isUnique_GlobalNumber(a)){a=Math.floor(Math.random()*1000)}return a};JsDatePick.prototype.isUnique_GlobalNumber=function(b){var a;for(a=0;a<g_arrayOfUsedJsDatePickCalsGlobalNumbers.length;a++){if(g_arrayOfUsedJsDatePickCalsGlobalNumbers[a]==b){return false}}return true};JsDatePick.prototype.addOnSelectedDelegate=function(a){if(typeof(a)=="function"){this.addonSelectedDelegate=a}return false};JsDatePick.prototype.setOnSelectedDelegate=function(a){if(typeof(a)=="function"){this.onSelectedDelegate=a;return true}return false};JsDatePick.prototype.executeOnSelectedDelegateIfExists=function(){if(typeof(this.onSelectedDelegate)=="function"){this.onSelectedDelegate()}if(typeof(this.addonSelectedDelegate)=="function"){this.addonSelectedDelegate()}};JsDatePick.prototype.setRepopulationDelegate=function(a){if(typeof(a)=="function"){this.repopulationDelegate=a;return true}return false};JsDatePick.prototype.setConfiguration=function(a){this.oConfiguration.isStripped=(a.isStripped!=null)?a.isStripped:false;this.oConfiguration.useMode=(a.useMode!=null)?a.useMode:1;this.oConfiguration.selectedDate=(a.selectedDate!=null)?a.selectedDate:null;this.oConfiguration.target=(a.target!=null)?a.target:null;this.oConfiguration.yearsRange=(a.yearsRange!=null)?a.yearsRange:[1971,2100];this.oConfiguration.limitToToday=(a.limitToToday!=null)?a.limitToToday:false;this.oConfiguration.field=(a.field!=null)?a.field:false;this.oConfiguration.cellColorScheme=(a.cellColorScheme!=null)?a.cellColorScheme:"ocean_blue";this.oConfiguration.dateFormat=(a.dateFormat!=null)?a.dateFormat:"%m-%d-%Y";this.oConfiguration.imgPath=(g_jsDatePickImagePath.length!=null)?g_jsDatePickImagePath:"img/";this.oConfiguration.weekStartDay=(a.weekStartDay!=null)?a.weekStartDay:1;this.selectedDayObject={};this.flag_DayMarkedBeforeRepopulation=false;this.flag_aDayWasSelected=false;this.lastMarkedDayObject=null;if(!this.oConfiguration.selectedDate){this.currentYear=this.oCurrentDay.year;this.currentMonth=this.oCurrentDay.month;this.currentDay=this.oCurrentDay.day}};JsDatePick.prototype.resizeCalendar=function(){this.leftWallStrechedElement.style.height="0px";this.rightWallStrechedElement.style.height="0px";var a=this.JsDatePickBox.offsetHeight,b=a-16;if(b<0){return}this.leftWallStrechedElement.style.height=b+"px";this.rightWallStrechedElement.style.height=b+"px";return true};JsDatePick.prototype.closeCalendar=function(){this.JsDatePickBox.style.display="none";document.onclick=function(){}};JsDatePick.prototype.populateFieldWithSelectedDate=function(){JsgetElem(this.oConfiguration.target).value=this.getSelectedDayFormatted();if(this.lastPickedDateObject){delete (this.lastPickedDateObject)}this.lastPickedDateObject={};this.lastPickedDateObject.day=this.selectedDayObject.day;this.lastPickedDateObject.month=this.selectedDayObject.month;this.lastPickedDateObject.year=this.selectedDayObject.year;this.closeCalendar()};JsDatePick.prototype.makeCalendar=function(){var j=document,e,a,b,k,g,h,f,o,i,m,n,l,c;e=j.createElement("div");a=j.createElement("div");b=j.createElement("div");this.setC(e,"JsDatePickBox");this.setC(a,"clearfix");this.setC(b,"jsDatePickCloseButton");b.setAttribute("globalNumber",this.globalNumber);b.onmouseover=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.CLOSE);d.setC(this,"jsDatePickCloseButtonOver")};b.onmouseout=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText("");d.setC(this,"jsDatePickCloseButton")};b.onmousedown=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.CLOSE);d.setC(this,"jsDatePickCloseButtonDown")};b.onmouseup=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText("");d.setC(this,"jsDatePickCloseButton");d.closeCalendar()};this.JsDatePickBox=e;k=j.createElement("div");g=j.createElement("div");h=j.createElement("div");f=j.createElement("div");this.setC(h,"topWall");this.setC(f,"bottomWall");if(this.isie&&this.iever==6){f.style.bottom="-2px"}o=j.createElement("div");i=j.createElement("div");m=j.createElement("div");this.setC(o,"leftTopCorner");this.setC(i,"leftBottomCorner");this.setC(m,"leftWall");this.leftWallStrechedElement=m;this.leftWall=k;this.rightWall=g;k.appendChild(o);k.appendChild(m);k.appendChild(i);o=j.createElement("div");i=j.createElement("div");m=j.createElement("div");this.setC(o,"rightTopCorner");this.setC(i,"rightBottomCorner");this.setC(m,"rightWall");this.rightWallStrechedElement=m;g.appendChild(o);g.appendChild(m);g.appendChild(i);if(this.oConfiguration.isStripped){this.setC(k,"hiddenBoxLeftWall");this.setC(g,"hiddenBoxRightWall")}else{this.setC(k,"boxLeftWall");this.setC(g,"boxRightWall")}e.appendChild(k);e.appendChild(this.getDOMCalendarStripped());e.appendChild(g);e.appendChild(a);if(!this.oConfiguration.isStripped){e.appendChild(b);e.appendChild(h);e.appendChild(f)}if(this.oConfiguration.useMode==2){if(this.oConfiguration.target!=false){if(typeof(JsgetElem(this.oConfiguration.target))!=null){n=JsgetElem(this.oConfiguration.target);l=document.createElement("span");n.parentNode.replaceChild(l,n);l.appendChild(n);n.setAttribute("globalNumber",this.globalNumber);n.onclick=function(){JsDatePick.getCalInstanceById(this.getAttribute("globalNumber")).showCalendar()};n.onfocus=function(){JsDatePick.getCalInstanceById(this.getAttribute("globalNumber")).showCalendar()};l.style.position="relative";this.initialZIndex++;e.style.zIndex=this.initialZIndex.toString();e.style.position="absolute";e.style.top="18px";e.style.left="0px";e.style.display="none";l.appendChild(e);c=new Function("g_arrayOfUsedJsDatePickCals["+this.globalNumber+"].populateFieldWithSelectedDate();");this.setOnSelectedDelegate(c)}else{alert(g_l.ERROR_3)}}}else{if(this.oConfiguration.target!=null){JsgetElem(this.oConfiguration.target).appendChild(e);JsgetElem(this.oConfiguration.target).style.position="relative";e.style.position="absolute";e.style.top="0px";e.style.left="0px";this.resizeCalendar();this.executePopulationDelegateIfExists()}else{alert(g_l.ERROR_4)}}};JsDatePick.prototype.determineFieldDate=function(){var b,c,e,g,l,d,a,h,k,f=false,j=false;if(this.lastPickedDateObject){this.setSelectedDay({year:parseInt(this.lastPickedDateObject.year),month:parseInt(this.lastPickedDateObject.month,10),day:parseInt(this.lastPickedDateObject.day,10)})}else{b=JsgetElem(this.oConfiguration.target);if(b.value.trim().length==0){this.unsetSelection();if(typeof(this.oConfiguration.selectedDate)=="object"&&this.oConfiguration.selectedDate){this.setSelectedDay({year:parseInt(this.oConfiguration.selectedDate.year),month:parseInt(this.oConfiguration.selectedDate.month,10),day:parseInt(this.oConfiguration.selectedDate.day,10)})}}else{if(b.value.trim().length>5){c=this.senseDivider(this.oConfiguration.dateFormat);e=this.oConfiguration.dateFormat;g=b.value.trim().split(c);l=e.trim().split(c);d=a=h=k=0;for(d=0;d<l.length;d++){switch(l[d]){case"%d":case"%j":a=d;break;case"%m":case"%n":k=d;break;case"%M":k=d;f=true;break;case"%F":k=d;j=true;break;case"%Y":case"%y":h=d}}if(f){for(d=0;d<12;d++){if(g_l.MONTHS[d].substr(0,3).toUpperCase()==g[k].toUpperCase()){k=d+1;break}}}else{if(j){for(d=0;d<12;d++){if(g_l.MONTHS[d].toLowerCase()==g[k].toLowerCase()){k=d+1;break}}}else{k=parseInt(g[k],10)}}this.setSelectedDay({year:parseInt(g[h],10),month:k,day:parseInt(g[a],10)})}else{this.unsetSelection();return}}}};JsDatePick.prototype.senseDivider=function(a){return a.replace("%d","").replace("%j","").replace("%m","").replace("%M","").replace("%n","").replace("%F","").replace("%Y","").replace("%y","").substr(0,1)};JsDatePick.prototype.showCalendar=function(){if(this.JsDatePickBox.style.display=="none"){this.determineFieldDate();this.JsDatePickBox.style.display="block";this.resizeCalendar();this.executePopulationDelegateIfExists();this.JsDatePickBox.onmouseover=function(){document.onclick=function(){}};this.JsDatePickBox.setAttribute("globalCalNumber",this.globalNumber);this.JsDatePickBox.onmouseout=function(){document.onclick=new Function("g_arrayOfUsedJsDatePickCals["+this.getAttribute("globalCalNumber")+"].closeCalendar();")}}else{return}};JsDatePick.prototype.isAvailable=function(c,a,b){if(c>this.oCurrentDay.year){return false}if(a>this.oCurrentDay.month&&c==this.oCurrentDay.year){return false}if(b>this.oCurrentDay.day&&a==this.oCurrentDay.month&&c==this.oCurrentDay.year){return false}return true};JsDatePick.prototype.getDOMCalendarStripped=function(){var h=document,e,i,b,a,f,c,g;e=h.createElement("div");if(this.oConfiguration.isStripped){this.setC(e,"boxMainStripped")}else{this.setC(e,"boxMain")}this.boxMain=e;i=h.createElement("div");b=h.createElement("div");a=h.createElement("div");f=h.createElement("div");c=h.createElement("div");g=h.createElement("div");this.setC(b,"clearfix");this.setC(g,"clearfix");this.setC(i,"boxMainInner");this.setC(a,"boxMainCellsContainer");this.setC(f,"tooltip");this.setC(c,"weekDaysRow");this.tooltip=f;e.appendChild(i);this.controlsBar=this.getDOMControlBar();this.makeDOMWeekDays(c);i.appendChild(this.controlsBar);i.appendChild(b);i.appendChild(f);i.appendChild(c);i.appendChild(a);i.appendChild(g);this.boxMainCellsContainer=a;this.populateMainBox(a);return e};JsDatePick.prototype.makeDOMWeekDays=function(a){var c=0,g=document,f=g_l.DAYS_3,e,b;for(c=this.oConfiguration.weekStartDay;c<7;c++){b=g.createElement("div");e=g.createTextNode(f[c]);this.setC(b,"weekDay");b.appendChild(e);a.appendChild(b)}if(this.oConfiguration.weekStartDay>0){for(c=0;c<this.oConfiguration.weekStartDay;c++){b=g.createElement("div");e=g.createTextNode(f[c]);this.setC(b,"weekDay");b.appendChild(e);a.appendChild(b)}}b.style.marginRight="0px"};JsDatePick.prototype.repopulateMainBox=function(){while(this.boxMainCellsContainer.firstChild){this.boxMainCellsContainer.removeChild(this.boxMainCellsContainer.firstChild)}this.populateMainBox(this.boxMainCellsContainer);this.resizeCalendar();this.executePopulationDelegateIfExists()};JsDatePick.prototype.executePopulationDelegateIfExists=function(){if(typeof(this.repopulationDelegate)=="function"){this.repopulationDelegate()}};JsDatePick.prototype.populateMainBox=function(h){var f=document,g,l,c=1,k=false,n=this.currentMonth-1,j,a,m,e,b;j=new Date(this.currentYear,n,1,1,0,0);a=j.getTime();this.flag_DayMarkedBeforeRepopulation=false;this.setControlBarText(this.monthsTextualRepresentation[n]+", "+this.currentYear);m=parseInt(j.getDay())-this.oConfiguration.weekStartDay;if(m<0){m=m+7}e=0;for(e=0;e<m;e++){g=f.createElement("div");this.setC(g,"skipDay");h.appendChild(g);if(c==7){c=1}else{c++}}while(j.getMonth()==n){k=false;g=f.createElement("div");if(this.lastPostedDay){if(this.lastPostedDay==j.getDate()){l=parseInt(this.lastPostedDay,10)+1}else{l=f.createTextNode(j.getDate())}}else{l=f.createTextNode(j.getDate())}g.appendChild(l);h.appendChild(g);g.setAttribute("globalNumber",this.globalNumber);if(c==7){if(g_jsDatePickDirectionality=="ltr"){g.style.marginRight="0px"}else{g.style.marginLeft="0px"}}if(this.isToday(j)){g.setAttribute("isToday",1)}if(this.oConfiguration.limitToToday){if(!this.isAvailable(this.currentYear,this.currentMonth,parseInt(j.getDate()))){k=true;g.setAttribute("isJsDatePickDisabled",1)}}g.onmouseover=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber")),i;i=d.getCurrentColorScheme();if(parseInt(this.getAttribute("isSelected"))==1){return}if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}if(parseInt(this.getAttribute("isToday"))==1){d.setC(this,"dayOverToday");this.style.backgroundColor="#000000"}else{d.setC(this,"dayOver");this.style.backgroundColor="#000000"}};g.onmouseout=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber")),i;i=d.getCurrentColorScheme();if(parseInt(this.getAttribute("isSelected"))==1){return}if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}if(parseInt(this.getAttribute("isToday"))==1){d.setC(this,"dayNormalToday");this.style.backgroundColor="#000"}else{d.setC(this,"dayNormal");this.style.background="url("+d.oConfiguration.imgPath+i+"_dayNormal.gif) left top no-repeat"}};g.onmousedown=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber")),i;i=d.getCurrentColorScheme();if(parseInt(this.getAttribute("isSelected"))==1){return}if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}if(parseInt(this.getAttribute("isToday"))==1){d.setC(this,"dayDownToday");this.style.background="url("+d.oConfiguration.imgPath+i+"_dayDown.gif) left top no-repeat"}else{d.setC(this,"dayDown");this.style.background="url("+d.oConfiguration.imgPath+i+"_dayDown.gif) left top no-repeat"}};g.onmouseup=function(){var d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber")),i;i=d.getCurrentColorScheme();if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}if(parseInt(this.getAttribute("isToday"))==1){d.setC(this,"dayNormalToday");this.style.background="url("+d.oConfiguration.imgPath+i+"_dayNormal.gif) left top no-repeat"}else{d.setC(this,"dayNormal");this.style.background="url("+d.oConfiguration.imgPath+i+"_dayNormal.gif) left top no-repeat"}d.setDaySelection(this);d.executeOnSelectedDelegateIfExists()};if(this.isSelectedDay(j.getDate())){g.setAttribute("isSelected",1);this.flag_DayMarkedBeforeRepopulation=true;this.lastMarkedDayObject=g;if(parseInt(g.getAttribute("isToday"))==1){this.setC(g,"dayDownToday");g.style.background="url("+this.oConfiguration.imgPath+this.oConfiguration.cellColorScheme+"_dayDown.gif) left top no-repeat"}else{this.setC(g,"dayDown");g.style.background="url("+this.oConfiguration.imgPath+this.oConfiguration.cellColorScheme+"_dayDown.gif) left top no-repeat"}}else{b=this.getCurrentColorScheme();if(parseInt(g.getAttribute("isToday"))==1){if(k){this.setC(g,"dayDisabled");g.style.background="url("+this.oConfiguration.imgPath+this.oConfiguration.cellColorScheme+"_dayNormal.gif) left top no-repeat"}else{this.setC(g,"dayNormalToday");g.style.background="url("+this.oConfiguration.imgPath+this.oConfiguration.cellColorScheme+"_dayNormal.gif) left top no-repeat"}}else{if(k){this.setC(g,"dayDisabled");g.style.background="url("+this.oConfiguration.imgPath+this.oConfiguration.cellColorScheme+"_dayNormal.gif) left top no-repeat"}else{this.setC(g,"dayNormal");g.style.background="url("+this.oConfiguration.imgPath+this.oConfiguration.cellColorScheme+"_dayNormal.gif) left top no-repeat"}}}if(c==7){c=1}else{c++}a+=86400000;j.setTime(a)}this.lastPostedDay=null;return h};JsDatePick.prototype.unsetSelection=function(){this.flag_aDayWasSelected=false;this.selectedDayObject={};this.repopulateMainBox()};JsDatePick.prototype.setSelectedDay=function(a){this.flag_aDayWasSelected=true;this.selectedDayObject.day=parseInt(a.day,10);this.selectedDayObject.month=parseInt(a.month,10);this.selectedDayObject.year=parseInt(a.year);this.currentMonth=a.month;this.currentYear=a.year;this.repopulateMainBox()};JsDatePick.prototype.isSelectedDay=function(a){if(this.flag_aDayWasSelected){if(parseInt(a)==this.selectedDayObject.day&&this.currentMonth==this.selectedDayObject.month&&this.currentYear==this.selectedDayObject.year){return true}else{return false}}return false};JsDatePick.prototype.getSelectedDay=function(){if(this.flag_aDayWasSelected){return this.selectedDayObject}else{return false}};JsDatePick.prototype.getSelectedDayFormatted=function(){if(this.flag_aDayWasSelected){var a=this.oConfiguration.dateFormat;a=a.replace("%d",this.selectedDayObject.day.toString().strpad());a=a.replace("%j",this.selectedDayObject.day);a=a.replace("%m",this.selectedDayObject.month.toString().strpad());a=a.replace("%M",g_l.MONTHS[this.selectedDayObject.month-1].substr(0,3).toUpperCase());a=a.replace("%n",this.selectedDayObject.month);a=a.replace("%F",g_l.MONTHS[this.selectedDayObject.month-1]);a=a.replace("%Y",this.selectedDayObject.year);a=a.replace("%y",this.selectedDayObject.year.toString().substr(2,2));return a}else{return false}};JsDatePick.prototype.setDaySelection=function(a){var b=this.getCurrentColorScheme();if(this.flag_DayMarkedBeforeRepopulation){this.lastMarkedDayObject.setAttribute("isSelected",0);if(parseInt(this.lastMarkedDayObject.getAttribute("isToday"))==1){this.setC(this.lastMarkedDayObject,"dayNormalToday");this.lastMarkedDayObject.style.background="url("+this.oConfiguration.imgPath+b+"_dayNormal.gif) left top no-repeat"}else{this.setC(this.lastMarkedDayObject,"dayNormal");this.lastMarkedDayObject.style.background="url("+this.oConfiguration.imgPath+b+"_dayNormal.gif) left top no-repeat"}}this.flag_aDayWasSelected=true;this.selectedDayObject.year=this.currentYear;this.selectedDayObject.month=this.currentMonth;this.selectedDayObject.day=parseInt(a.innerHTML);this.flag_DayMarkedBeforeRepopulation=true;this.lastMarkedDayObject=a;a.setAttribute("isSelected",1);if(parseInt(a.getAttribute("isToday"))==1){this.setC(a,"dayDownToday");a.style.background="url("+this.oConfiguration.imgPath+b+"_dayDown.gif) left top no-repeat"}else{this.setC(a,"dayDown");a.style.background="url("+this.oConfiguration.imgPath+b+"_dayDown.gif) left top no-repeat"}};JsDatePick.prototype.isToday=function(a){var b=this.oCurrentDay.month-1;if(a.getDate()==this.oCurrentDay.day&&a.getMonth()==b&&a.getFullYear()==this.oCurrentDay.year){return true}return false};JsDatePick.prototype.setControlBarText=function(a){var b=document.createTextNode(a);while(this.controlsBarTextCell.firstChild){this.controlsBarTextCell.removeChild(this.controlsBarTextCell.firstChild)}this.controlsBarTextCell.appendChild(b)};JsDatePick.prototype.setTooltipText=function(a){while(this.tooltip.firstChild){this.tooltip.removeChild(this.tooltip.firstChild)}var b=document.createTextNode(a);this.tooltip.appendChild(b)};JsDatePick.prototype.moveForwardOneYear=function(){var a=this.currentYear+1;if(a<parseInt(this.oConfiguration.yearsRange[1])){this.currentYear++;this.repopulateMainBox();return true}else{return false}};JsDatePick.prototype.moveBackOneYear=function(){var a=this.currentYear-1;if(a>parseInt(this.oConfiguration.yearsRange[0])){this.currentYear--;this.repopulateMainBox();return true}else{return false}};JsDatePick.prototype.moveForwardOneMonth=function(){if(this.currentMonth<12){this.currentMonth++}else{if(this.moveForwardOneYear()){this.currentMonth=1}else{this.currentMonth=12}}this.repopulateMainBox()};JsDatePick.prototype.moveBackOneMonth=function(){if(this.currentMonth>1){this.currentMonth--}else{if(this.moveBackOneYear()){this.currentMonth=12}else{this.currentMonth=1}}this.repopulateMainBox()};JsDatePick.prototype.getCurrentColorScheme=function(){return this.oConfiguration.cellColorScheme};JsDatePick.prototype.getDOMControlBar=function(){var h=document,c,f,g,b,a,e;c=h.createElement("div");f=h.createElement("div");g=h.createElement("div");b=h.createElement("div");a=h.createElement("div");e=h.createElement("div");this.setC(c,"controlsBar");this.setC(f,"monthForwardButton");this.setC(g,"monthBackwardButton");this.setC(b,"yearForwardButton");this.setC(a,"yearBackwardButton");this.setC(e,"controlsBarText");c.setAttribute("globalNumber",this.globalNumber);f.setAttribute("globalNumber",this.globalNumber);g.setAttribute("globalNumber",this.globalNumber);a.setAttribute("globalNumber",this.globalNumber);b.setAttribute("globalNumber",this.globalNumber);this.controlsBarTextCell=e;c.appendChild(f);c.appendChild(g);c.appendChild(b);c.appendChild(a);c.appendChild(e);f.onmouseover=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}d=this.parentNode;while(d.className!="controlsBar"){d=d.parentNode}i=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));i.setTooltipText(g_l.MONTH_FWD);i.setC(this,"monthForwardButtonOver")};f.onmouseout=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText("");d.setC(this,"monthForwardButton")};f.onmousedown=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}d=this.parentNode;while(d.className!="controlsBar"){d=d.parentNode}i=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));i.setTooltipText(g_l.MONTH_FWD);i.setC(this,"monthForwardButtonDown")};f.onmouseup=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.MONTH_FWD);d.setC(this,"monthForwardButton");d.moveForwardOneMonth()};g.onmouseover=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.MONTH_BCK);d.setC(this,"monthBackwardButtonOver")};g.onmouseout=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText("");d.setC(this,"monthBackwardButton")};g.onmousedown=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.MONTH_BCK);d.setC(this,"monthBackwardButtonDown")};g.onmouseup=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.MONTH_BCK);d.setC(this,"monthBackwardButton");d.moveBackOneMonth()};b.onmouseover=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.YEAR_FWD);d.setC(this,"yearForwardButtonOver")};b.onmouseout=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText("");d.setC(this,"yearForwardButton")};b.onmousedown=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.YEAR_FWD);d.setC(this,"yearForwardButtonDown")};b.onmouseup=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.YEAR_FWD);d.setC(this,"yearForwardButton");d.moveForwardOneYear()};a.onmouseover=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.YEAR_BCK);d.setC(this,"yearBackwardButtonOver")};a.onmouseout=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText("");d.setC(this,"yearBackwardButton")};a.onmousedown=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.YEAR_BCK);d.setC(this,"yearBackwardButtonDown")};a.onmouseup=function(){var i,d;if(parseInt(this.getAttribute("isJsDatePickDisabled"))==1){return}i=this.parentNode;while(i.className!="controlsBar"){i=i.parentNode}d=JsDatePick.getCalInstanceById(this.getAttribute("globalNumber"));d.setTooltipText(g_l.YEAR_BCK);d.setC(this,"yearBackwardButton");d.moveBackOneYear()};return c};
// To fix this.style.background="url("+d.oConfiguration.imgPath+i+"_dayOver.gif
//
//
$('span.tabs2_tab').on('click', function() { other_tab_clicked(); } );
$('body').append('<div class="redalert" id="alarmmsg" style="padding:10px;display:none;left:670px;top:25px;width:auto;height:auto;position:absolute;"><div>');
console.log('#=#=#=# starting Aloop 3');
// #activity_24cb798130002d887db0138975c301b1\.108_div > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1)
// #activity_24cb798130002d887db0138975c301b1\.108_div > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > img:nth-child(2)
// #\35 4eb39c5a8c82944d86e3b396c50ae0a\.img
// var p = 2;
// do {
// $("table[id^='activity_detail']").find('tr.activity_data:nth-child(' + p + ') > td:nth-child(1) > span:nth-child(1) > div:nth-child(1)').each( function() {
// var obj = $(this);
// if ( obj.text().toUpperCase().indexOf('REF:') > 0 ) {
// var rf = obj.text().substr(obj.text().toUpperCase().indexOf('REF:'),18);
// console.log('#=#=Ref:', rf);
// Ref:MSGDDN81132590
// }
// console.log('#=#=Ref:', p , obj.find('table#AutoNumer9 > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > div:nth-child(7) ').length );
// });
// p = p + 3;
// } while ($('tr.activity_data:nth-child(' + p + ') > td:nth-child(1) > span:nth-child(1) > div:nth-child(1)').length);
console.log('#=#=#=# starting Aloop 4 Getting SLA OLA ');
var crow = 1;
var hold = 0;
var color = '#FFFFFF';
var tml = '';
var col,col2,col3;
var exst = $('#' + script + '\\.task_sla\\.task_table').attr('total_rows');
console.log('#=#=#=# starting Aloop 4.0' , exst);
if ( exst > 0 ) {
col = findcol( script + '.task_sla.task_table','task_sla.u_current_stage');
col2 = findcol( script + '.task_sla.task_table','task_sla.business_percentage');
col3 = findcol( script + '.task_sla.task_table','task_sla.business_time_left');
col4 = findcol( script + '.task_sla.task_table','task_sla.u_breach_reason_code');
col5 = findcol( script + '.task_sla.task_table','task_sla.sla.name');
console.log('#=#= cols=', col, col2, col3 );
}
while ( crow <= exst ) {
// console.log('#==',$('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col + ') ').text() );
if ( $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col + ') ').text() === 'In progress' ) {
console.log('#==',$('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col2 + ') ').text() );
p = Number($('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col2 + ') ').text().replace(',','.') );
if ( p > hold ) {
hold = p;
color = $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col2 + ') ').css('background-color');
tml = $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col3 + ') ').text();
}
}
console.log('#== %%=', crow, Number( $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col2 + ') ').text().replace(',','.') ) );
if ( $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col + ') ').text() == 'Breached' ) {
if ( $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col4 + ') ').text() === '' ) {
problem_msg = problem_msg + '<p>' + $('#' + script + '\\.task_sla\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col5 + ') ').text() + '<br>Uncommented breach!! <br>You may want to reject this case<hr>';
}
}
crow++;
}
// tml ='';
console.log('#=#=#=# starting Aloop 4.1 Color short decription and number with SLA/OLA priority' , color );
// hold = 96;
// color = 'transparent';
if (hold > 0 ) {tml = hold + '% Time left is : ' + tml;}
if ( color === 'transparent' ) {
// color = '#00001c';
txtc = '#FFFFFF';
var fldclass = 'my_list_sla_0';
if ( hold > 10 ) { fldclass = 'my_list_sla_1'; }
if ( hold > 25 ) { fldclass = 'my_list_sla_2'; }
if ( hold > 35 ) { fldclass = 'my_list_sla_3'; }
if ( hold > 50 ) { fldclass = 'my_list_sla_4'; }
if ( hold > 75 ) { fldclass = 'my_list_sla_5'; }
if ( hold > 83 ) { fldclass = 'my_list_sla_6'; }
if ( hold > 90 ) { fldclass = 'my_list_sla_7'; }
if ( hold > 95 ) { fldclass = 'my_list_sla_8'; }
console.log('#=#=#=# starting Aloop 4.1.0 ' , color , txtc );
} else {
txtc = '#000';
$('#sys_readonly\\.' + script + '\\.number').css('background-color', color);
$('#' + script + '\\.short_description' ).css('background-color', color);
console.log('#=#=#=# starting Aloop 4.1.0 ' , color , txtc );
}
console.log('#=#=#=# starting Aloop 4.1.1 ' , color, txtc );
// if (color !== '#FFF' && color !== '#FFFFFF' && color !== 'transparent' && txtc ) {
// var oldstyle = $('#' + script + '\\.short_description').attr('style').replace('background: transparent none repeat scroll 0% 0%; color: rgb(0, 0, 0);','');
// oldstyle += 'background-color:'+ color + ' !important;color:' + txtc + ' !important;padding:2px 0px 2px 4px !important;';
// $('#' + script + '\\.short_description' ).attr('style', oldstyle).addClass(fldclass);
// oldstyle = $('#sys_readonly\\.' + script + '\\.number').attr('style').replace('background: transparent none repeat scroll 0% 0%; color: rgb(0, 0, 0);','');
// oldstyle += 'background-color:'+ color + ' !important;color:' + txtc + ' !important;padding:2px 0px 2px 4px !important;';
// $('#sys_readonly\\.' + script + '\\.number').attr('style', oldstyle).addClass(fldclass);
// }
console.log('#=#=#=# starting Aloop 4.1.2 ' , color );
$('#sys_readonly\\.' + script + '\\.number').addClass(fldclass);
$('#' + script + '\\.short_description' ).addClass(fldclass);
$('#sys_readonly\\.' + script + '\\.number').attr('title',tml );
$('#' + script + '\\.short_description' ).attr('title',tml);
var serials = '';
crow = 1;
exst = $('#' + script + '\\.task_ci\\.task_table').attr('total_rows');
console.log('#=#=#=# starting Aloop 4.2 get serials' , exst);
if ( exst > 0 ) {
col = findcol( script + '.task_ci.task_table','task_ci.ci_item.serial_number');
col1 = findcol( script + '.task_ci.task_table','task_ci.ci_item');
}
while ( crow <= exst ) {
console.log('#=#=#=# starting Aloop 4.2.1 get serials' , $('#' + script + '\\.task_ci\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col + ') ').text() );
t = $('#' + script + '\\.task_ci\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col + ') ').text();
if ( t.indexOf('VIRT_') == -1 && t.length > 2 ) {
serials = serials + t;
}
t = $('#' + script + '\\.task_ci\\.task_table > tbody:nth-child(2) > tr:nth-child(' + crow + ') > td:nth-child(' + col1 + ') ').text();
if ( t.indexOf(',') > -1 ) {
serials = serials + t.split(',')[1].trim();
if ( serials.indexOf(' ') > -1 ) {
serials = serials.split(' ')[0];
}
serials = serials + ',';
}
crow++;
}
if ( $('#sys_display\\.' + script + '\\.u_product').val().indexOf('VIRT') == -1 && exst == 1 && serials !== '') { serial_number = serials.replace(',',''); }
console.log('#=#=#=# starting Aloop 4.3 ' + col + ' ['+ serial_number + ']' );
$('textarea#' + script + '\\.u_redirect_comments').on('change keypress', function(){
$('textarea#activity-stream-work_notes-textarea').val('Redirect Comments:\n\n' + $('textarea#' + script + '\\.u_redirect_comments').val());
});
console.log('#=#=#=# starting Aloop 5');
// table#u_request.task_ci.task_table table with serial .....
if ( $('#' + script + '\\.task_ci\\.task_table').attr('last_row') === '1' ) {
var ci_link = $('table#' + script + '\\.task_ci\\.task_table > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > a:nth-child(1)').attr('href');
$('#ci-lst').append('<a title="Show this CI details" href="' + ci_link + '" target="_blank"><img src="images/timer_start.gifx" style="width:14px;height:14px;"></a>').show();
}
// External ref
// table #u_request\.u_ext_ref_no\.u_task_table
// tbody tr #row_u_request\.u_ext_ref_no\.u_task_90353d0f0f17a50001b89c3be1050ef6
// -- casenr description -- url
//
// Aloop Main part
//
//
console.log('#=#=#=# Main part 5340');
if (typeof unsafeWindow == "undefined") { unsafeWindow = window; }
$('body').append('<div id="showpic" style="width:auto;height:auto;position:absolute;display:none;"></div>'); // show images in this div
$('body').append('<div id="caldiv" style="width:230px;height:250px;position:absolute;display:none;"><div id="relposdiv" style="position:relative;"></div></div>');
var mycal = new JsDatePick({
useMode:1,
target:"relposdiv",
isStripped:true,
dateFormat:"%d-%M-%Y",
weekStartDay:1
});
/*selectedDate:{ This is an example of what the full configuration offers.
day:5, For full documentation about these settings please see the full version of the code.
month:9,
year:2006
},
yearsRange:[1978,2020],
limitToToday:false,
cellColorScheme:"beige",
dateFormat:"%m-%d-%Y",
imgPath:"img/",
weekStartDay:1*/
mycal.setOnSelectedDelegate(function(){
var obj = mycal.getSelectedDay();
var datestr = '"' + obj.day + '/' + obj.month + '/' + obj.year + '"';
$('#caldiv').hide();
var nowdate = new Date();
// var eta = wkd[nowdate.getDay()] + ' ' + s(nowdate.getDate()) + '-' + mnt[nowdate.getMonth()] + '-' + nowdate.getFullYear();
// console.log('#t#=#=# now.....', eta);
var newdate = new Date(obj.year,obj.month-1 ,obj.day,0,0,0,0);
// var eta = wkd[newdate.getDay()] + ' ' + s(newdate.getDate()) + '-' + mnt[newdate.getMonth()] + '-' + newdate.getFullYear();
// console.log('#t#=#=# target.....', eta);
var timeDiff = newdate.getTime() - nowdate.getTime();
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
if (diffDays < 1) { diffDays=1; }
console.log('#t#=#=# diff.....', diffDays);
add_eta(diffDays);
// alert("a date was just selected and the date is : " + datestr + " " + diffDays);
});
if ( typeof unsafeWindow.globalContext['affected\.user\.contact\.details'] === undefined ) { // Loop until we can get requester email from globalContext, no longer undefined
console.log('#=#=#=# Waiting.....');
window.setTimeout(Aloop,200);
} else {
timer6 = new Date();
console.log('#=#=#=# Start ITSM use default Email client');
var btbg = '';
Assignee = $('#sys_display\\.' + script + '\\.assigned_to').attr('value') || ''; // Get Assignee of case
$('#' + script + '\\.u_next_step_displayed').change(dingdong); // 780 Set to completed
$('#' + script + '\\.u_accepted').change(dingdong2); // 2 rejected
console.log('#=#=#=# Assignee is ' + Assignee + ' and resolvedby is ' + unsafeWindow.g_form.getValue('sys_display.' + script + '.u_resolved_by') );
if ( Assignee.length > 1 && unsafeWindow.g_form.getValue(script + '.u_resolved_by').length < 1 ) {
var tq = unsafeWindow.g_form.getValue(script + '.assigned_to');
unsafeWindow.g_form.setValue(script + '.u_resolved_by', tq);
unsafeWindow.g_form.setValue('sys_display.' + script + '.u_resolved_by', Assignee);
console.log('#=#=#=# Set Resolvedby to ' + Assignee + ' ' + tq);
} else {
console.log('#=#=#=# Resolvedby unchanged');
}
if ( $('#ui_macro_task_charge').length ) {
t = Number($('#ui_macro_task_charge > td:nth-child(2)').text().replace(/ /g,'') );
console.log('# task_charge ' + t + ' => ' + $('#' + script + '\\.u_actual_charge').val() );
if ( $('#' + script + '\\.u_actual_charge').val() === '' && t > 0) {
$('#' + script + '\\.u_actual_charge').val(t);
$('#' + script + '\\.u_charge_change_reason').val('Same as current task charge.');
} else {
t = Number($('#' + script + '\\.u_actual_charge').val().replace(/ /g,'')) ;
if ( t > 0 ) { $('#' + script + '\\.u_actual_charge').val(t); }
}
}
console.log('#=#=#=# Check customer email etc');
MyFirstName = Assignee.split(' ')[0]; // Get First name from Assignee
MyLastName = Assignee.split(' ')[1]; // Get First name from Assignee
var detailsArr = [];
var nbr = '';
if (typeof unsafeWindow.globalContext['requester\.contact\.details'] !== "undefined" ) {
detailsArr = unsafeWindow.globalContext['requester\.contact\.details'].split(',') || []; // Pull array from globalContext
console.log('#=#= add requester ');
console.log ('#=#=#',detailsArr );
if (detailsArr[3].toString() !== '' ) {
nbr = detailsArr[3].toString().replace(/\s/g,'');
$('#rq-lst').append('<a class="phnlnk" title="Call ' + detailsArr[0].toString().replace(/\s/g,'') + ' ' + detailsArr[1].toString().trim() + ' on ' + nbr + '" href="tel:' + nbr + '" ></a>');
console.log('#=#= add requester phone');
}
if (detailsArr[4].toString() !== '' ) {
nbr = detailsArr[4].toString().replace(/\s/g,'');
$('#rq-lst').append('<a class="phnlnk" title="Call ' + detailsArr[0].toString().replace(/\s/g,'') + ' ' + detailsArr[1].toString().trim() + ' on ' + nbr + '" href="tel:' + nbr + '" ></a>');
console.log('#=#= add requester mobile');
}
}
if (typeof unsafeWindow.globalContext['affected\.user\.contact\.details'] !== "undefined" ) {
detailsArr = unsafeWindow.globalContext['affected\.user\.contact\.details'].split(',') || []; // Pull array from globalContext
console.log('#=#= add affected user ');
console.log ('#=#=#',detailsArr );
if (detailsArr[3].toString() !== '' ) {
// #view\.u_request\.u_caller
nbr = detailsArr[3].toString().replace(/\s/g,'');
$('#ac-lst').append('<a class="phnlnk" title="Call ' + detailsArr[0].toString().replace(/\s/g,'') + ' ' + detailsArr[1].toString().trim() + ' on ' + nbr + '" href="tel:' + nbr + '" ></a>').show();
console.log('#=#= add affected user phone');
}
if (detailsArr[4].toString() !== '' ) {
nbr = detailsArr[4].toString().replace(/\s/g,'');
$('#ac-lst').append('<a class="phnlnk" title="Call ' + detailsArr[0].toString().replace(/\s/g,'') + ' ' + detailsArr[1].toString().trim() + ' on ' + nbr + '" href="tel:' + nbr + '" ></a>').show();
console.log('#=#= add affected user mobile');
}
}
var recep = '';
// var custfn,custln = ''; // has become a global value
if (detailsArr.length > 2 ) {
recep = detailsArr[6].toString().toLowerCase(); // Get requester email
custfn = FirstLUcase(detailsArr[0].toString().trim());
custln = FirstLUcase(detailsArr[1].toString().trim());
}
if ( $('#element\\.' + script + '\\.comments\\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:last-child > td:nth-child(1) > span:nth-child(1)').length === 0 ) { console.log("No initial entry ??? !!!\n\nOekandanou ??? !!! "); } else {
var it = $('#element\\.' + script + '\\.comments\\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:last-child > td:nth-child(1) > span:nth-child(1)').html().toLowerCase();
if (it.indexOf(recep) < 0) {
console.log('#=#=#=# Email ' + recep + ' niet gevonden'); // #u_request.u_accepted
console.log('#=#=#=# Case state, accepted 1 or not 0 : ' + $('#' + script + '\\.u_accepted').val() ); // Has the case been accepted 1 or not 0
if ( $('#' + script + '\\.u_accepted').val() === 0 ) { console.log('Contact [ ' + recep + ' ] not found in initial mail \n\n' + it ); }
btbg = 'alertbg';
tit = ' Bad Contact for case!! \n Contact [' + recep + '] not found in initial mail!! ';
}
}
console.log('#=#=#=# Create reassign button');
$('#ag-lst').append(' <A id="closeq" style=""><img src="images/request_completed.gifx" title=""></img></A><A id="closeq2" style=""><img title="Reassign to closure queue and UPDATE" src="/images/green_back.gifx" title=""></img></A>');
// $('#closeq').hide();
// $('#closeq2').hide();
console.log('#=#=#=# get to and cc list vars');
var tolist = GM_getValue('tolist'+casenr,''); // Must add
var cclist = GM_getValue('cclist'+casenr,''); // Get stored cclist
if (cclist) {
if (cclist === '') { GM_setValue('cclist'+casenr,''); } else {cclist = ';' + cclist;}
} else { cclist = ''; }
tolist = tolist.replace(recep,'').replace(/ /g,';').replace(/;;/g,';');
MyDear = MyDear.replace('{fn}',custfn);
MyDear = MyDear.replace('{ln}',custln);
var tosub, mbody, mcc;
tosub = 'mailto://' + recep + ';' + tolist + '?subject=RE: ' + casenr + ' - ' + encodeURIComponent($('#' + script + '\\.short_description').attr('value') ); // Put the requester email address, [6] in array, in mailto:// and (SVR nr + short description) in subject
mbody = '&body=' + MyDear + parsevars(MyMGSbody) + '%0A%0D' + caseref;
mcc = '&[email protected]'+ cclist;
var mlt = tosub + mbody + mcc;
if($('#email_client_open').length === 0 ) { myalert("email button not found ??? !!!\n\nOekandanou ??? !!!"); } // Do we see the email link?
else { // Yes we do
if ( recep.indexOf('nomail')>0 || recep.indexOf('donotuse.com')>0 ){ // Detect noemail and flag with red envelope
btbg = 'faultbg'; tit = 'Bad email address!\nReject case.';}
else {
if ( btbg === '') {btbg = btcol; var tit = 'Default mail client';}
}
}
var mailoptions = '';
for (var idx = 0, len = MailTemplName.length; idx < len; idx++) {
mailoptions += '<option style="background-image:url(images/icons/email.gifx);background-repeat:no-repeat;background-position:1px; " title="' + MailTemplName[idx] + '" value="' + idx + '" selected>__ ' + MailTemplName[idx] + '</option>'
}
$('<span id="pagetm" style="text-decoration:none;font-weight:normal;font-size:8px;" ></span> <span id="anotif" style="color:#000;background-color:#FFA500;"></span> <span class="hov"><A id="hoptest" style="text-decoration:none;font-weight:normal; "> Hi ' + loggedin+ ', ITSM+ version : ' + scriptversion + ' on ' + instance + ' </A> </span> \
<span id="mailstuff"><A id="n_email" style="text-decoration:none;"><img class="i16x16" src="images/icons/email.gifx" title="'+ tit +'"></img></A><select id="mailtype" style="display:none;"> \
' + mailoptions + '</select></span> <A id="cc" style="text-decoration:none;"><img class="i16x16" src="images/icons/edit.gifx" title="Mail Client Configuration"></img></A>\
<A id="set" style="display:none;"><img class="i16x16" src="images/pick_list.gifx" title="Not yet :-)"></img></A> \
<A class="rfsh" style="text-decoration:none;"><img class="i16x16" src="images/icons/refresh.gifx" title="Reload"></img></A> ').insertBefore('div.container-fluid:first > div.navbar-right > span:nth-child(1)');
if (instance === 'sandbox') { $('#email_client_open').parent().parent().parent().css('background-color','#ffdc73'); }
if (instance === 'orion' ) { $('#email_client_open').parent().parent().parent().css('background-color','#ff7373'); }
if (recep === '') {
problem_msg = problem_msg + '<p> No requester Email ??? !!! <BR>Perhaps request GSC to add a contact with an emailaddress. <hr>';
// $('span#anotif').html(' No requester Email ??? !!! Perhaps request GSC to add a contact with an emailaddress. ').css('padding','7px');
}
$('#mailstuff').addClass(btbg);
// $('#n_email img:first-child').addClass(btbg); // Adjust the image
$('#n_email').click( function() {
console.log('# n_email clicked');
changemailink(0);
}); //.attr('href', mlt); // Adjust the link
$('#cc img:first-child').addClass(btcol);
$('#cc').click(managecclist);
if ( loggedin == 'Michel Hegeraat' ) {
$('#set').attr('style','text-decoration:none;').click(showform);
$('#set img:first-child').addClass(btcol);
}
$('#mailtype').attr('style','text-decoration:none;margin-left:-3px;').val(0).on('change', function () {
var msel = this.value;
var idx = $('#mailtype option:selected').index();
// console.log('maillink update ', rnow , shortassign );.replace('{dt}',rnow).replace('{sa}',shortassign).replace('{sp=}',sep1).replace('{sp/}',sep2).replace('{tm}',rtime)
changemailink(msel);
// var t = MailTemplate[idx].replace('{fn}',custfn).replace('{ln}',custln).replace(/{mf}/g,MyFirstName).replace(/{ml}/g,MyLastName).replace(/{mn}/g,Assignee).replace(/\n/g,'%0A%0D');
// window.top.location = tosub + '&body=' + t + mcc; return false;
console.log('maillink update idx ' + msel + ' ' );
});
// if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { $('#mailtype').css('width','12px'); }
$('#ooo').attr('href', 'mailto://' + recep + oooMSG + MyFirstName);
// Herve asked to add his email to official email client
var tmpq = $('#email_client_open').attr('query');
// console.log("#==# email_client query: " + $('#email_client_open').attr('query') );
$('#email_client_open').attr('query', tmpq + '^ORmymail=' + Assignee.replace(' ','.') + '@eu.didata.com');
// <a id="email_client_open" tabindex="0" onclick="emailClientOpen(this, 'u_request');"
// query="active=true
// ^assigned_to=javascript:getMyAssignments()
// ^sys_domain_number!=0
// ^u_service_centreIN0b37a5356fcf8d406c265ebd5d3ee462
// ^ORu_service_centreISEMPTY
// ^ORassignment_group=javascript:getMyGroups()
// ^ORu_responsible_owner_group=javascript:getMyGroups()
// ^ORu_owner_group=javascript:getMyGroups()
// ^ORDERBYassigned_to
// ^[email protected]">
// <img class="i16x16" title="Email" src="images/icons/email.gifx"></a>
//
// https://dimensiondataservices.service-now.com/email_client.do?
// sysparm_table=u_request&sysparm_sys_id=d4ec5eb70f82710428bbcfbce1050eb9
// &sysparm_target=u_request
// &sys_target=u_request
// &sys_uniqueValue=d4ec5eb70f82710428bbcfbce1050eb9
// &sys_row=0
// &sysparm_encoded_record=
// &sysparm_stack=no
// console.log('#==# ', unsafeWindow.getMyAssignments() );
// console.log('#==# ', getMyAssignments() );
console.log("#=#=#=# loggedin = '"+ loggedin + "'");
if ( loggedin == 'Michel Hegeraat' ) {
console.log('#=#=#=# adding test1 click listener');
$('#hoptest').click(test1);
}
console.log('#=#=#=# ### LOG tab ###', $('#label\\.' + script + '\\.\\.formatter\\.activity\\.xml').length);
$('span#status\\.' + script + '\\.\\.formatter\\.activity\\.xml').parent().each( function(){ //### LOG tab ###
var obj = $(this);
obj.append('<A class="rfsh"><IMG title="Reload" src="images/icons/refresh.gifx" style="float:right"></IMG></A>'); // Add refresh
obj.append(' <A id="swht-log" style="float:right;margin-right: 15px;"> SWOW-hi-lite </A>'); // Add SWOW-hi-lite
});
$('<A class="rfsh"><IMG title="Reload" src="images/icons/refresh.gifx" style="float:right"></IMG></A> <A id="swht-log" style="float:right;margin-right: 15px;"> SWOW-hi-lite </A>').insertBefore('#activity_field_filter_popover');
$('#label\\.' + script + '\\.work_notes').parent().show()
console.log('#=#=#=# ### WORK NOTES tab ###', $('#label\\.' + script + '\\.work_notes').length);
$('#label\\.' + script + '\\.work_notes').each( function(){ //### WORK NOTES tab ###
var obj = $(this);
obj.append('<A id="wivaonoff2"><IMG id="wivaimg2" class="i16x16" src="images/activity_filter_on.gifx" style="margin-left:15px;"></IMG></A>');
obj.append('<span id="wiva2" style="display:none">\
<select id="wims5" style="background-color:#DFE;border:0px solid;"></select> \
<select id="wims6" style="background-color:#DFE;border:0px solid;"></select> \
<select id="wims7" style="background-color:#DFE;border:0px solid;"></select> \
<select id="wims8" style="background-color:#DFE;border:0px solid;"></select> \
</span> <a class="showconf" title=" \n Configure Actions.\n Change displayed options and associated actions \n"><img src=images/icons/bsm2.gifx></img></a>');
obj.append(' <A class="rfsh"><IMG title="Reload" src="images/icons/refresh.gifx" style="float:right"></IMG></A>');
});
$('#label\\.' + script + '\\.comments').parent().show()
console.log('#=#=#=# ### COMMENTS tab ###', $('#label\\.' + script + '\\.comments').length);
// $('#label\\.' + script + '\\.comments')
$("label[for='" + script + "\\.comments']").parent().each( function(){ //### COMMENTS tab ###
var obj = $(this);
obj.append('<A class="rfsh"><IMG title="Reload" src="images/icons/refresh.gifx" style="float:right"></IMG></A>'); // Add refresh
if ( loggedin == 'Michel Hegeraaat' ) {
obj.append('<A id="tst4" style="float:right;margin-right: 15px;">t4</A> ');
obj.append('<A id="tst3" style="float:right;margin-right: 15px;">t3</A> ');
obj.append('<A id="tst2" style="float:right;margin-right: 15px;">t2</A> ');
obj.append('<A id="tst1" style="float:right;margin-right: 15px;">t1</A> ');
}
console.log('#=#=#=# Add SWOW-hi-lite button');
obj.append(' <a id="findphns" title="Find and hilite phonenumbers in the case notes."><img width=14 height=14 src="images/mobile/phone.gifx" style="float:right"/></a> <A id="swht" style="float:right;margin-right: 15px;"> SWOW-hi-lite </A> '); // Add SWOW-hi-lite
if ( ro === 0 ) {
obj = $('#label\\.' + script + '\\.comments');
console.log('#=#=#=# Add swow button');
obj.append(' <A id="swow" title="Show the SWOW screen"> SWOW </A>'); // Add swow button
obj.append('<A id="wivaonoff"><IMG id="wivaimg" class="i16x16" src="images/activity_filter_on.gifx" style="margin-left:15px;"></IMG></A>');
obj.append('<span id="wiva" style="display:none">\
<select id="wims1" style="background-color:#DFE;border:0px solid;"></select> \
<select id="wims2" style="background-color:#DFE;border:0px solid;"></select> \
<select id="wims3" style="background-color:#DFE;border:0px solid;"></select> \
<select id="wims4" style="background-color:#DFE;border:0px solid;"></select> \
</span> <a class="showconf" title=" \n Configure Actions.\n Change displayed options and associated actions \n\n Change Email Templates.\n Change or define new email templates for the default email client.\n \n"><img src=images/icons/bsm2.gifx></img></a>');
}
});
console.log('#=#=#=# Activate swow buttons'); // Add list button
$("#swow").click(show_swow).addClass('mybut');
// .css('background-color', '#FFF').css('border', "solid 2px " + btcol);
$("#swht").click(swowhilite).addClass('mybut');
$("#swht-log").click(swowhilitelog).addClass('mybut');
$("A.showconf").each( function() {
$(this).click(showform);
});
console.log('#=#=#=# Form options'); // Add list button
// if ( loggedin == 'Michel Hegeraat' || loggedin == 'Wim Vanhalewijck') {
$("#wim1").click(wim1_f).addClass('mybut');
$("#wim2").click(wim2_f).addClass('mybut');
$("#wim3").click(wim3_f).addClass('mybut');
$('#wims1').on('change', function() { wims_f(1, this.value ); });
$('#wims2').on('change', function() { wims_f(1, this.value ); });
$('#wims3').on('change', function() { wims_f(1, this.value ); });
$('#wims4').on('change', function() { wims_f(1, this.value ); });
$('#wims5').on('change', function() { wims_f(2, this.value ); });
$('#wims6').on('change', function() { wims_f(2, this.value ); });
$('#wims7').on('change', function() { wims_f(2, this.value ); });
$('#wims8').on('change', function() { wims_f(2, this.value ); });
// }
console.log('#=#=#=# Activate refresh buttons');
$(".rfsh").click(rfsh);
$("#findphns").on('click', function() { searchphn();} );
if ( loggedin == 'Michel Hegeraat' ) {
$("#tst1").click(test1).addClass('mybut');
$("#tst2").click(test2).addClass('mybut');
$("#tst3").click(test3).addClass('mybut');
$("#tst4").click(test4).addClass('mybut');
}
$("#wivaonoff").click(wiva_on_off);
$("#wivaonoff2").click(wiva_on_off);
if (GM_getValue('wivastate') === 'on' ) {
$('#wiva').css('display','inline');
$('#wivaimg').attr('src','images/activity_filter_off.gifx');
$('#wiva2').css('display','inline');
$('#wivaimg2').attr('src','images/activity_filter_off.gifx');
}
if( $('#lookup\\.' + script + '\\.u_caller').length === 0 ) { console.log("#=#=#=# not found id #lookup\\." + script + "\\.u_caller !! Whats wrong? " ); }
else {
console.log('#=#=#=# Add list button ' ); // Add list button
$('#lookup\\.' + script + '\\.u_caller').closest('td').find('span.ref_contributions').attr('id','rqlst');
$('#rq-lst').append('<A id="lijst" title="Contact list"><img src="images/reference_list.gifx"></img></A>');
var cust;
$("#lijst").click(show_list).css('width', '14px'); // .addClass(btcol)
}
// #element\.u_request\.comments\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > span:nth-child(1)
// $('#element\\.' + script + '\\.comments\\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) ').find('span').hlitephnnr();
// $('#element\\.' + script + '\\.comments\\.additional > td:nth-child(1) > span:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) ').find('span').highlight("Romain");
$('.phnlnk').append('<img class="phncl" width=14 height=14 src="images/mobile/phone.gifx"/>');
$('.phnlnk1').append('<img class="phncl" width=14 height=14 src="images/mobile/phone.gifx"/>');
$('.phncl').click(function() {
var info = $(this).parent().attr("title");
phonecall(info);
// return false;
});
if (problem_msg === '' && loggedin === 'Michel Hegeraat ' ) { problem_msg = '<p>Testing 123<br>nog een lijn<br> nog wat <hr>'; }
if (problem_msg !== '' ) { myalert( problem_msg ); }
if ( $('A#lookup\\.' + script + '\\.u_major:visible') ) {
// if ( $('div.info_box:contains("Possible parent")').length > 0 ) { alert('found');}
$('div.info_box:contains("Possible parent")').hide();
$('A#lookup\\.' + script + '\\.u_major').css('border','2px #ffff26 solid');
$('A#lookup\\.' + script + '\\.u_major').hover( function() { $('div.info_box:contains("Possible parent")').fadeIn(700); } , function() { $('div.info_box:contains("Possible parent")').hide(200); } );
}
var chk4nwcstmr = setInterval( function() {
// console.log('#=#= call chk4nwcs');
chk4nwcs();
} , 120000);
console.log('#=#=#=# Add listener for top alert');
$('#toplrt').on('click', function() {
console.log('#=#=#=# Alarm button clicked 0' );
var imgpos = document.getElementById('toplrt').getBoundingClientRect();
y = imgpos.bottom + 3;
x = imgpos.left -10;
var t = $('#toplrt img:first-child').attr('src');
console.log('#=#=#=# Alarm button clicked' , t , t.indexOf('expand_sm') );
if ( t.indexOf('expand_sm') > 0 ) {
$('#toplrt').css('paddingBottom','8px').css('borderBottomWidth','0px');
$('#toplrt img:first-child').attr('src','/images/arrows_collapse_sm.gifx');
console.log('#=#=#=# image set to ^ (hide)' , $('#toplrt img:first-child').attr('src') );
$('#alarmmsg').css('top',y + 'px').css('left',x + 'px').show(500);
} else {
$('#toplrt').css('paddingBottom','4px').css('borderBottomWidth','1px');
$('#toplrt img:first-child').attr('src','/images/arrows_expand_sm.gifx');
console.log('#=#=#=# image set to v (show)' , $('#toplrt img:first-child').attr('src') );
$('#alarmmsg').hide(500);
}
});
}
if ( loggedin == 'Michel Hegeraat' ) {
setInterval( function() {
console.log('#=#= wanker call');
wanker( Math.floor( Math.random()*(10) ) );
}, 30000);
}
if ( loggedin == 'Hans Depre' ) {
setInterval( function() {
console.log('#=#= wanker call');
wanker( Math.floor( Math.random()*(10) ) );
}, 60000);
}
$('#' + script + '\\.comments').focus();
console.log('#=#=#=# move tabs');
tabs_move('contractchange',0);
if ( loggedin == 'Michel Hegeraat ' ) {
tabs_test('Tab_5+',5);
tabs_test('Tab_4',1);
tabs_test('Tab_3',4);
tabs_test('Tab_2',3);
// $('span.tab_caption_text:contains("Bulk")').parent().show().parent().show().next().show();
// $('span.tabs2_section[tab_caption_raw="Bulk CI changes"] > span:nth-child(1)').show().children().show();
// $('span.tab_caption_text:contains("Integration")').parent().show().parent().show().next().show();
// $('span.tabs2_section[tab_caption_raw="Integration messages log"] > span:nth-child(1)').show().children().show();
}
$('span.tab_caption_text:contains("Custom")').parent().show().parent().show().next().show();
$('span.tabs2_section[tab_caption_raw="Custom section"] > span:nth-child(1)').show().children().show();
console.log('#=#=#=# tabs sober');
$('div#tabs2_section').append('<img id=sober class=tabs2_tab src=images/activity_filter_off.gifx style="padding-right:1px;margin-bottom:6px;padding-top:3px;padding-bottom:2px;"/> '); // padding-right:4px;margin-bottom:4px;padding-top:3px;
// alert(mytabs['Scram'], mytabs[2]);
tab_secret();
tab_moveit();
console.log('#=#=#=# tab MoveIt');
// if ( loggedin == 'Michel Hegeraat' ) { }
tab_webex();
console.log('#=#=#=# tab Webex');
tab_scram();
console.log('#=#=#=# tab Scram');
tabs_test('ITSM+',6);
console.log('#=#=#=# tab ITSM+');
tabs_tpcases();
console.log('#=#=#=# tab TPcases');
tabs_test('RMA',2);
console.log('#=#=#=# tabs RMA');
insertTab('HOPLA', 2, 1);
tab_hide('HOPLA');
var secretNoErr = true;
$('img#secretimg').bind('error', function(e){
tab_hide('Secret');
secretNoErr = false;
});
if (mytabs['Secret'] < 1) { tab_hide('Secret'); }
if (mytabs['Scram'] < 1) { tab_hide('Scram'); }
if (mytabs['Webex'] < 1) { tab_hide('Webex'); }
if (mytabs['MOVEit'] < 1) { tab_hide('MOVEit'); }
console.log('#=#=#=# hide tabs escalation ', mytabs['Escalation'], mytabs['Stakeholders'] );
if (mytabs['Escalation'] < 1) { tab_hide('Escalation'); }
if (mytabs['Stakeholders'] < 1) { tab_hide('Stakeholders'); }
if (mytabs['Custom section'] < 1) { tab_hide('Custom section'); }
case_tabs_hover();
$('.tab_caption_text').addClass('noselect'); // no text select on buttons
if ( loggedin == 'Sebastiaan Noppe' ) {
}
$('div#tabs2_section > img:nth-child(1)').remove();
$('div#tabs2_section').prepend('<img id=godown class=tabs2_tab src=images/arrows_expand_sm.gifx?v=2 style="padding-right:4px;margin-bottom:6px;padding-top:3px;"/> ');
$('div#tabs2_list').prepend('<img id=goup class=tabs2_tab src=images/arrows_collapse_sm.gifx?v=2 style="padding-right:4px;margin-bottom:6px;padding-top:3px;"/> ');
console.log('#=#=#=# tabs extra');
if ( GM_getValue('activetab') ) {
tab_cap = GM_getValue('activetab');
$('span.tabs2_active' ).removeClass("tabs2_active");
$('span#' + tab_cap).parent().addClass( "tabs2_active");
$('span.tabs2_section').each( function() {
var obj = $(this);
// console.log('#=#=# section ' + obj.attr('tab_caption') + '.' );
if (obj.attr('tab_caption') === tab_cap.replace('\\','') ) {
console.log('#=#=# Show section span ' + tab_cap + '.' );
if ( $('img#img\\.' + tab_cap).attr('src') !== 'images/section_hide.gifx' ) { $( this ).show(); }
} else {
if (obj.attr('tab_caption') !== 'Request' && obj.attr('tab_caption') !== 'Incident') { $( this ).hide(); }
}
});
$('table.tabs2_section').each( function() {
var obj = $(this);
if (obj.attr('tab_caption') === tab_cap.replace('\\','') ) {
console.log('#=#=# Show section tbl ' + tab_cap + '.' );
$( this ).show();
} else {
if (obj.attr('tab_caption') !== 'Request' && obj.attr('tab_caption') !== 'Incident') { $( this ).hide(); }
}
});
}
$('#godown').addClass("tabs_header").on('click', function() {
document.getElementById("tabs2_list").scrollIntoView( { behavior: "smooth"} );
});
$('#goup').addClass("tabs_header").on('click', function() {
document.getElementById( script + ".short_description").scrollIntoView( { block: "end", behavior: "smooth"} );
});
$('#sober' ).addClass("tabs_header").on('click', function() {
if ($('#sober').attr('src').indexOf('_on') > -1) {
$('#sober').attr('src','images/activity_filter_off.gifx');
tab_show('RMA');
if (mytabs['Secret'] > 0 && secretNoErr ) { tab_show('Secret'); }
if (mytabs['Scram'] > 0) { tab_show('Scram'); }
if (mytabs['Webex'] > 0) { tab_show('Webex'); }
if (mytabs['MOVEit'] > 0) { tab_show('MOVEit'); }
tab_show('Tab_2');
tab_show('Tab_3');
tab_show('Tab_4');
tab_show('Tab_5+');
tab_show('Bulk CI changes');
tab_show('Integration messages log');
if (mytabs['Escalation'] > 0) { tab_show('Escalation'); }
if (mytabs['Stakeholders'] > 0) { tab_show('Stakeholders'); }
if (mytabs['Custom section'] > 0) { tab_show('Custom section'); }
tab_show('OtherTab');
} else {
$('#sober').attr('src','images/activity_filter_on.gifx');
tab_hide('RMA');
tab_hide('Secret');
tab_hide('Scram');
tab_hide('Webex');
tab_hide('MOVEit');
tab_hide('Tab_2');
tab_hide('Tab_3');
tab_hide('Tab_4');
tab_hide('Tab_5+');
tab_hide('Bulk CI changes');
tab_hide('Integration messages log');
tab_hide('Escalation');
tab_hide('Stakeholders');
tab_hide('Custom section');
tab_hide('OtherTab');
}
});
$('#godown').hover( function() { $( this ).addClass("tabs2_hover"); },function() { $( this ).removeClass("tabs2_hover"); } );
$('#goup' ).hover( function() { $( this ).addClass("tabs2_hover"); },function() { $( this ).removeClass("tabs2_hover"); } );
$('#sober' ).hover( function() { $( this ).addClass("tabs2_hover"); },function() { $( this ).removeClass("tabs2_hover"); } );
// $('button.form_action_button').addClass('mybut').css('border-color','#FFF');
$('button.action_context').addClass('mybut').css('border-color','#FFF');
// $('.mybut').removeClass('action_context').removeClass('form_action_button');
console.log('#=#=# anchor closure_details exists', $('#tabs2_section > h3:nth-child(10) > span:nth-child(1)').length );
$('#tabs2_section > h3:nth-child(10) > span:nth-child(1)').attr('tabindex','5').attr('id','clodet');
var closure_details = $('#tabs2_section > h3:nth-child(10) > span:nth-child(1) > span:nth-child(1)');
if ( closure_details.length == 0 ) {
closure_details = $('div#tabs2_section > .tab_header:nth-child(10) > .tabs2_tab:nth-child(1) > span:nth-child(1)');
} else {
closure_details.attr('id','clodet_img');
}
console.log('#=#=# anchor closure_details exists', closure_details.length, closure_details.css('visibility'), closure_details.hasClass('mandatory') );
console.log('#=#=# Add l1 l2 ===== 1');
// def_mesg = '<p><hr><p><h2>Open new TP case</h2><hr><p>\
// <a class="mybut" target="_blank" href="https://tools.cisco.com/ServiceRequestTool/scm/mgmt/case?referring_site=support_mm">Cisco</a>   \
// <a class="mybut" target="_blank" href="https://support.emc.com/servicecenter/createSR/">EMC</a>   \
// <a class="mybut" target="_blank" href="https://support.infoblox.com/app/ask">Infoblox</a>   \
// <a class="mybut" target="_blank" href="https://na4.salesforce.com/secur/login_portal.jsp?orgId=00D3000000001oV&portalId=06060000000D3gX">nimsoft</a>   <p>\
// <span>Avaya </span>   \
// <span>Bluecoat </span>   \
// <span>Checkpoint</span>   \
// <span>F5 </span>   <p>\
// <span>Fortinet </span>   \
// <span>Juniper </span>   \
// <span>NTT </span>   \
// <span>palo alto </span>   \
// <p><hr>\
// <p><h2>The ITSM+ scripts that are available now :</h2><hr><p><ul><font color=blue>\
// <li><a href="https://greasyfork.org/scripts/6264-itsm-task-list/code/ITSM%20task%20list.user.js" title=" Color your tasklist based on running SLA/OLA. ">Task list script.</a></li>\
// <li><a href="https://greasyfork.org/en/scripts/4566-itsm-use-default-mail-client/code/ITSM_Use_Default_Mail_client.user.js" title=" Send ITSM mails using outlook and much more. ">Default Mail client script.</a></li>\
// <li><a href="https://greasyfork.org/scripts/10483-itsm-navigation-do/code/ITSM%20Navigationdo.user.js" title=" First go at adjusting the navigation menu ">ITSM navigation menu script.</a></li>\
// <li><a href="https://greasyfork.org/scripts/10603-dark-theme/code/Dark%20theme.user.js" title=" ITSM dark theme script. ">Feel the atraction of the << DARK SIDE >>?</a></li>\
// <li><a href="https://greasyfork.org/scripts/8557-email-client-do/code/ITSM%20email_client_do.user.js" title=" Adds email address to the email_client_do page, the official ITSM web mail. ">ITSM web mail script.</a></li>\
// </font></ul><p>Click the script name to install it<p>or find all the scripts right <a href="https://greasyfork.org/en/scripts/search?q=ITSM">here</a> <hr>';
// $('<h3 class="tab_header"><span class="tabs2_tab mytab" tabindex="0" style=";padding-right:0px;"><span id="ITSMITSM" class="itsm" style="margin-right:2px"><img src="images/s.gifx" alt="" style="width: 4px; height: 12px; margin: 0px;"></img></span><span class="tab_caption_text">ITSMITSM</span></span></h3><img class="tab_spacer" width="4" height="24" src="images/s.gifx" />').appendTo( $('div#tabs2_section') );
// if ( $('#' + script + '\\.u_custom_date_1').val() === '' ) {
// $('#myinfo_box').text( ' Add a SWOW Update!!! ' ).addClass('info_box');
// }
$('#label\\.' + script + '\\.number').css('color',$('#label\\.' + script + '\\.u_submitted_on').css('color')).css('background-color', $('#label\\.' + script + '\\.u_submitted_on').css('background-color') ).css('font-weight','initial');
console.log('#=#=# Add l1 l2 ===== 2');
if ( loggedin == 'Michel Hegeraat' ) {
// if ( $('#sys_readonly\\.' + script + '\\.state option:selected').text() === 'Active' && $('#sys_readonly\\.' + script + '\\.u_next_step option:selected').text() === '-- None --' ) {
// $('#' + script + '\\.u_next_step_displayed option[value="20"]').prop('selected', true);
// $('#' + script + '\\.u_accepted option[value="1"]').prop('selected', true);
//// unsafeWindow.g_form.setValue(script + '.u_accepted', 1);
// } else {
// if ( $('#' + script + '\\.u_next_step_displayed option[value="1275"]').length == 0 && $('#' + script + '\\.u_next_step').val() !== '1275' ) {
//// $('#' + script + '\\.u_next_step_displayed').append('<option value="1275">Pending deferred action</option>');
// }
if ( $('#' + script + '\\.u_next_step').val() === '100' ) {
$('#' + script + '\\.u_next_step_displayed').append('<option value="-27" >Pending Third Party</option>');
}
}
// var curstate = $('#sys_readonly\\.' + script + '\\.state option:selected').text();
//
// if (['Pending deffered action','Client action','Work in progress'].indexOf(curstate) > -1 ) {
// unsafeWindow.g_form.setValue(script + '.u_accepted', 1);
// }
if ( $('#sys_display\\.' + script + '\\assigned_to').val() !== '' ) {
// unsafeWindow.g_form.setValue(script + '.u_accepted', 1);
$('#' + script + '\\.u_accepted option[value="1"]').prop('selected', true);
}
console.log('#=#=# Add l1 l2 ===== 3');
// }
console.log('#=#=# Add l1 l2');
$('tr#l0').after('<tr id="l1" class=mytr title="Update fields via SWOW"></tr><tr id="l2" class=mytr title="Update fields via SWOW"></tr><tr id="l3" style="display:none;"></td><tr id="l4"></tr>'); //
var p = $('input#' + script + '\\.u_custom_text_3').val().split(';');
for (i = 0; i <4 ; i++) { info[i] = (p[i] && p[i] !== 'undefined') ? p[i]:''; }
if (serial_number.indexOf('ITSM_CI') == -1 && info[2] === '') { info[2] = serial_number; }
if ( $('#sys_display\\.' + script + '\\.u_product').val().length > 0 && info[0] === '' ) {
if ( $('#sys_display\\.' + script + '\\.u_product').val().indexOf('VIRT') == -1 ) {
info[0] = $('#sys_display\\.' + script + '\\.u_product').val();
}
}
if (!prbstat ) { prbstat =''; }
var wlstat = '';
var cfstat = '';
var mfstat = '';
// $('#l1').html('<td title="Update fields via SWOW" colspan=2><span style="display:block;white-space: nowrap;"><p class=mylbl>Status:</p><p class="myspc"></p><p class=myfld>' + prbstat + '</p><p class="myspc"></p><p class=mylbl>ETA:</p><p class="myspc"></p><p class=myfld>' + etadt.replace(/\//g,'-') + '</p><p class="myspc"></p><p class=mylbl> Vendor contract:</p><p class="myspc"></p><p class=myfld>' + info[3] + '</p></span></td>');
// $('#l2').html('<td title="Update fields via SWOW" colspan=2><span style="display:block;white-space: nowrap;"><p class=mylbl>Product:</p><p class="myspc"></p><p class=myfld>' + info[0] + '</p><p class="myspc"></p><p class=mylbl>Serial:</p><p class="myspc"></p><p class=myfld>' + info[2] + '</p><p class="myspc"></p><p class=mylbl>Version:</p><p class="myspc"></p><p class=myfld>' + info[1] + '</p></span></td>');
// $('#l3').html('<td colspan=2><span style="display:none;white-space: nowrap;"><p class=mylblc>workload:</p><p class="myspc"></p><p class=myfldc>' + wlstat + '</p><p class=mylblc>Closure Fields:</p><p class="myspc"></p><p class=myfldc>' + cfstat + '</p><p class="myspc"></p><p class=mylblc>Mandatory Fields:</p><p class="myspc"></p><p class=myfldc>' + mfstat + '</p></span></td>');
$('#l1').html('<td class=mylbl>Status: </td><td class="myspc"></td><td class=myfld>' + prbstat + '</td><td class="myspc"></td><td class=mylbl>ETA:</td><td class="myspc"></td><td class=myfld>' + etadt.replace(/\//g,'-') + '</td><td class="myspc"></td><td class=mylbl>Vendor contract:</td><td class="myspc"></td><td class=myfld>' + info[3] + '</td><td> </td>');
$('#l2').html('<td class=mylbl>Product:</td><td class="myspc"></td><td class=myfld>' + info[0] + '</td><td class="myspc"></td><td class=mylbl>Serial:</td><td class="myspc"></td><td class=myfld>' + info[2] + '</td><td class="myspc"></td><td class=mylbl>Version:</td><td class="myspc"></td><td class=myfld>' + info[1] + '</td><td> </td>');
$('#l3').html('<td class=mylblc>workload:</td><td class="myspc"></td><td class=myfldc>' + wlstat + '</td><td class="myspc"></td><td class=mylblc>Closure Fields:</td><td class="myspc"></td><td class=myfldc>' + cfstat + '</td><td class="myspc"></td><td class=mylblc>Mandatory Fields:</td><td class="myspc"></td><td class=myfldc>' + mfstat + '</td><td class="myspc"></td><td class=mylblc> </td><td class="myspc"></td><td class=myfldc> </td><td> </td>');
console.log('#=#=# Add l1 l2 done');
console.log('# infobox ' + $('#element\\.' + script + '\\.u_contract').next().find('div.info_box').text() );
// Check if an email is present in the notes
// need to see if email is in mlt href If not add to to:
//
// var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
// if(is_chrome){
$("a[href^='mailto:']").on("click", function() { window.top.location = $(this).prop("href"); return false;}); // Helper for Chrome to make mailto href work on https page
$("a[href^='tel:']" ).on("click", function() { window.top.location = $(this).prop("href"); return false;}); // Helper for Chrome to make tel href work on https page
$("a[href^='im:']" ).on("click", function() { window.top.location = $(this).prop("href"); return false;}); // Helper for Chrome to make im href work on https page
$("a[href^='xmpp:']" ).on("click", function() { window.top.location = $(this).prop("href"); return false;}); // Helper for Chrome to make xmpp href work on https page
// }
form2options();
console.log('#=#=#=# dingdong');
console.log('#=#=#',loggedin, MyFirstName,MyLastName);
if (MyFirstName) {
myemail = MyFirstName.toLowerCase() + '.' + MyLastName.toLowerCase() + '@dimensiondata.com';
} else {
myemail = loggedin.replace(' ','.') + '@dimensiondata.com';
}
GM_setValue('curlist', mlt + '&FROM=' + myemail );
var prevaction = Number($('#sys_readonly\\.' + script + '\\.u_next_step option:selected').val()); // 6 Resolved
console.log('#=#=#=# Hide these buttons for now ' + prevaction );
if ( ok2close.indexOf(prevaction) == -1 ) { // 9 Review
$("#closeq").hide(); // 120 Set to restored
$("#closeq2").hide(); // 120 Set to restored
console.log('#=#=#=# Hide this button for now ' + prevaction ); // 130 Set to resolved
ClosingCase = false ;
} else { // 220 Close or cancel task
ClosingCase = true;
$('select' ).on('change', function(event) { check4change(event); });
$('input' ).on('change keypress', function(event) { check4change(event); });
$('textarea').on('change keypress', function(event) { check4change(event); });
$('input#sys_display\\.' + script + '\\.u_task_resolution_code').blur(mandatory_fields);
$('input#sys_display\\.' + script + '\\.u_task_rootcause' ).blur(mandatory_fields);
$('textarea#' + script + '\\.close_notes' ).blur(mandatory_fields);
$('textarea#' + script + '\\.u_root_cause_comments' ).blur(mandatory_fields);
mandatory_fields();
}
console.log('#=#=#=# infobox hide ');
// fieldmsg notification notification-info
$('div.notification-info').each( function() {
var o = $(this);
var q = o.parent().parent().parent();
var id = q.attr('id');
var t = q.find('span.icon-search');
var tmri;
if (id) {
id = id.replace(/\./g,'_');
setTimeout( function() {
o.attr('id', 'ib_' + id).fadeOut(2000);
t.addClass('srch_ib');
},5000 );
t.hover( function() {
$('div#ib_'+id).fadeIn(300);
clearTimeout(tmri);
} , function() {
tmri = setTimeout( function() { $('div#ib_'+id).hide(2000); }, 3000);
});
}
});
// GM_addStyle(' div#' + script + '.section_header_spacer { visibility:hidden !important; display:none !important; height:20px !important; }');
// GM_addStyle(' .outputmsg_div { visibility:hidden !important; display:none !important; }');
// GM_addStyle(' #output_messages { visibility:hidden !important; display:none !important; }');
console.log('#=#=#=# outputmsg hide ');
setTimeout( function() {
$('.outputmsg_div').fadeOut(2000);
$('.outputmsg').fadeOut(2000);
$('#output_messages').fadeOut(2000);
$('#pagetm').text( $('span.timing_span').text()() );
// $('#pagetm').html( $('#page_timing_div').html() );
console.log('#=#=#= pagetm ' + $('#page_timing_div').text() ) ;
},5000 );
// alert( $('a.btn.btn-default').length );
// $('a.btn.btn-default').addClass('height15').css('height','15px').attr('style','height:15px !important;padding:0px !important;');
$('a.btn.btn-default').addClass('height15').css('height','15px').attr('style','height:15px !important;padding:0px !important; width:16px !important;');
$('span.required-marker').attr('style','color:red !important; width:10px !important;');
// $('div.input-group-3').html( $('div.input-group-1').html() + $('div.input-group-3').html() ).parent().removeClass('no-left-padding-lg');
// $('div.input-group-1').parent().remove();
// $('<div id=effort></div>').insertAfter('div.input-group-3').parent(); //
// $('<div id=effort class="" style="display:table;"></div>').appendTo('span#' + script + '\\.u_effort_entry');
// $('span#' + script + '\\.u_effort_entry > div:nth-child(1) > div:nth-child(1) > span:nth-child(1)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(1) > div:nth-child(1) > input:nth-child(2)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > span:nth-child(1)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > input:nth-child(2)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > span:nth-child(3)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > input:nth-child(4)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > span:nth-child(5)').clone( true ).appendTo( "#effort" );
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > input:nth-child(6)').clone( true ).appendTo( "#effort" );
//
// $('span#' + script + '\\.u_effort_entry > div:nth-child(1)').remove();
// $('span#' + script + '\\.u_effort_entry > div:nth-child(1)').remove();
//
$('span#' + script + '\\.u_effort_entry > div:nth-child(1) > div:nth-child(1)').find('input').css('width','30px').css('display','table-cell'); // .addClass('no-left-padding-lg');
$('span#' + script + '\\.u_effort_entry > div:nth-child(1) > div:nth-child(1)').attr('style','left:15px;width:65px !important;');
$('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1)').attr('style','left:15px;width:135px !important;');
$('span#' + script + '\\.u_effort_entry > div:nth-child(1)').attr('style','width:70px !important;');
$('span#' + script + '\\.u_effort_entry > div:nth-child(2)').attr('style','width:140px !important;');
$('span#' + script + '\\.u_effort_entry > div:nth-child(1) > div:nth-child(1) > span:nth-child(1) > label:nth-child(1)').css('padding','0px 4px 0px 4px');
$('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1) > span:nth-child(1) > label:nth-child(1)').css('padding','0px 4px 0px 4px');
// $('span#' + script + '\\.u_effort_entry > div:nth-child(2) > div:nth-child(1)').find('input').css('width','30px').css('display','table-cell'); // .addClass('no-left-padding-lg');
// $('input#ni\\.' + script + '\\.u_effortdur_day' ).attr('style','width:30px !important;');
$('input#ni\\.' + script + '\\.u_effortdur_hour').attr('style','width:30px !important;');
$('input#ni\\.' + script + '\\.u_effortdur_min' ).attr('style','width:30px !important;');
$('input#ni\\.' + script + '\\.u_effortdur_sec' ).attr('style','width:30px !important;');
console.log('# topdiv ' , $('div#element\\.' + script + '\\.company').length );
console.log('# topdiv ' , $('div#element\\.' + script + '\\.company').parent().length );
console.log('# topdiv ' , $('div#element\\.' + script + '\\.company').parent().parent().length );
var topdiv = $('div#element\\.' + script + '\\.company').parent().parent();
console.log('# topdiv ' , topdiv.length );
var ictr = 0;
topdiv.find('img').each( function(){
// if ( $(this)[0].hasAttribute("class") && $(this)[0].hasAttribute("style") ) {
$(this).addClass('i16x16');
// }
ictr++;
});
console.log('# ictr ' , ictr );
// setTimeout( function() {
console.log('# IM elements ' , $('td.tdwrap:nth-child(1) > strong:nth-child(1) > a:nth-child(1)[href*="data.com"]').length );
var ownerIM = '';
var AssignIM = '';
var own_nm = $('#sys_display\\.' + script + '\\.u_owner').val().replace(/\s/g,'')
var ass_nm = $('#sys_display\\.' + script + '\\.assigned_to').val().replace(/\s/g,'')
console.log('# IM elements ow as ' , own_nm , ass_nm );
// $('td.tdwrap:nth-child(1) > strong:nth-child(1) > a:nth-child(1)[href*="data.com"]').each( function() {
// #element\.u_request\.comments\.additional > span:nth-child(1) > div:nth-child(1) > div:nth-child(2) > span:nth-child(1) > strong:nth-child(1) > a:nth-child(1)
$('div > span.tdwrap > strong:nth-child(1) > a:nth-child(1)').each( function() {
var personemail = $(this).attr('href').split('ame=')[1];
var personname = $(this).text();
console.log('# IM elements pn pe ' , personname , personemail );
if ( personname !== loggedin ) {
$(this).parent().append(' <span class=itsmplus> <a href="xmpp:' + personemail + '" title="Jabber IM"><img src=' + GM_getResourceURL('jabbericon') + ' class=i14x /></a> <a href="im:<sip:' + personemail + '>" title="Lync IM"><img src=' + GM_getResourceURL('lyncicon') + ' class=i16x16 style="background-color:white;" /></a> </span>');
}
personname = personname.replace(/\s/g,'').replace('.','')
console.log('# IM elements t ' , personname.substr(1,10) , own_nm.substr(1,10) );
if ( ownerIM === '' && personname.substr(0,10) === own_nm.substr(0,10) ) {
ownerIM = '<a href="xmpp:' + personemail + '" title="Jabber IM"><img src=' + GM_getResourceURL('jabbericon') + ' class=i14x /></a> <a href="im:<sip:' + personemail + '>" title="Lync IM"><img src=' + GM_getResourceURL('lyncicon') + ' class=i16x16 style="background-color:white;" /></a>';
$('#ao-lst').append(ownerIM).show();
}
if ( AssignIM === '' && personname === ass_nm ) {
AssignIM = '<span class=itsmplus><a href="xmpp:' + personemail + '" title="Jabber IM"><img src=' + GM_getResourceURL('jabbericon') + ' class=i14x /></a> <a href="im:<sip:' + personemail + '>" title="Lync IM"><img src=' + GM_getResourceURL('lyncicon') + ' class=i16x16 style="background-color:white;" /></a> </span>';
$('#sys_display\\.' + script + '\\.assigned_to').closest('div.form-field-addons').append(AssignIM);
}
});
// console.log('# IM elements ', ownerIM , $('#sys_display\\.' + script + '\\.u_owner').val() );
// },10 );
swowhilite();
swowhilitelog();
// direction: ltr; overflow: hidden; overflow-wrap: break-word; resize: none; height: 50px;
$('#' + script + '\\.comments' ).attr('style','').css('resize','both').css('height','150px').css('width','100%');
$('#' + script + '\\.work_notes').attr('style','').css('resize','both').css('height','150px').css('width','100%');
// .on('keyup', function(){ });
// $('#activity-stream-unordered-list-entries').on('change', function() {
// swowhilitelog();
// });
// $('a[style*="visibility: hidden"]').css('display', 'none');
console.log('#=# performance? ' , unsafeWindow.performance.timing , unsafeWindow.performance.navigation );
var loadTime = unsafeWindow.performance.timing.domContentLoadedEventEnd - unsafeWindow.performance.timing.navigationStart;
console.log('#=# Page load time is ' , loadTime);
$('#pagetm').hover( function() {
$('#pagetm').addClass('ptmhover');
},function() {
setTimeout( function() { $('#pagetm').removeClass('ptmhover'); },3000 );
});
pageperf();
// ==================================================
//
} // End of Aloop
//
// ==================================================
console.log('#=#=#= End of Aloop ') ;
// $('input.input-group-addon').removeClass('input-group-addon');
$('div.annotation-wrapper').each( function(){
// console.log('#=#=#= ' + $(this).text() );
$(this).parent().removeAttr('style').removeClass('annotation');
if ($(this).text() ==='TEst') { $(this).css('display','none'); }
if ($(this).text() ==='') { $(this).css('display','none'); }
});
$('#request_manager_output',unsafeWindow.parent.document).css('display','inline');
return 0;
// ==================================================
//
}); // end off $(document).ready
//
// ==================================================
function pageperf() {
var pgperf = unsafeWindow.performance.timing;
var timerlast = new Date();
var t0 = pgperf.domainLookupStart;
var t1 = pgperf.domainLookupEnd;
var t2 = pgperf.requestStart;
var t3 = pgperf.responseStart;
var t4 = pgperf.responseEnd;
var t5 = pgperf.domContentLoadedEventStart;
var t6 = timer0.getTime();
var t7 = pgperf.domContentLoadedEventEnd;
var t8 = timerlast.getTime();
console.log('#=# Page domainLookupStart is ' , pgperf.domainLookupStart );
console.log('#=# Page domainLookupEnd is ' , pgperf.domainLookupEnd );
console.log('#=# Page requestStart is ' , pgperf.requestStart );
// console.log('#=# Page requestEnd is ' , pgperf.requestEnd );
console.log('#=# Page responseStart is ' , pgperf.responseStart );
console.log('#=# Page responseEnd is ' , pgperf.responseEnd );
console.log('#=# Page domContentLoadedEventStart is ' , pgperf.domContentLoadedEventStart );
console.log('#=# timer0 msec ' , timer0.getTime() );
console.log('#=# Page domContentLoadedEventEnd is ' , pgperf.domContentLoadedEventEnd );
console.log('#=# timerlast msec ' , timerlast.getTime() );
console.log('#=# Page loadEventStart is ' , pgperf.loadEventStart );
console.log('#=# Page loadEventEnd is ' , pgperf.loadEventEnd );
console.log('# timerlast msec 0 ' , timerlast - timer0 );
console.log('# timerlast msec 1 ' , timerlast - timer1 );
console.log('# timerlast msec 2 ' , timerlast - timer2 );
console.log('# timerlast msec 3 ' , timerlast - timer3 );
console.log('# timerlast msec 4 Aloop' , timerlast - timer4 );
console.log('# timerlast msec 5 ' , timerlast - timer5 );
console.log('# timerlast msec 6 ' , timerlast - timer6 );
console.log('# timer ' + $('span.timing_span').text() + 'ITSM+: ' + (timerlast - timer4) );
$('#pagetm').text( $('span.timing_span').text() + 'including ITSM+: ' + (timerlast - timer4) ).css('float','left');
}
function ShPoName(txt) {
if (txt === 'ACV/CSC' ) { txt = 'ACV-CSC';}
if (txt === 'Colruyt Group Services' ) { txt = 'Colruyt';}
if (txt === 'Emmaüs' ) { txt = 'EMMAUS ZIEKENHUIS';}
if (txt === 'GlaxoSmithKline' ) { txt = 'GSK';}
if (txt === 'HOPITAL ERASME' ) { txt = 'HÔPITAL ERASME';}
if (txt === 'Ineos Manufacturing' ) { txt = 'Ineos';}
if (txt === 'Vlaamse Radio- en Televisieomroep VRT' ) { txt = 'VRT';}
return txt.toUpperCase();
}
jQuery.fn.hlitephnnr = function () {
// var re = new RegExp("[0-9-():+ \/\.]{10,20}", 'gi');
var re = new RegExp("[0-9( :+/.)\\\-]{10,22}", 'g');
var re2 = new RegExp("[0-9]", 'g');
return this.each(function () {
$(this).contents().filter(function() {
return this.nodeType == 3 && re.test(this.nodeValue);
}).replaceWith(function() {
return (this.nodeValue || "").replace(re, function(match) {
function fixnr(phnnr) {
var fixphnnr = phnnr.replace(/[ \-\:./]/g,'');
fixphnnr = fixphnnr.replace(/\./g,'');
fixphnnr = fixphnnr.replace('(0)','').replace(')','').replace('(','');
fixphnnr = fixphnnr.replace(/\+\+/g,'').replace(/\-\-/g,'');
fixphnnr = fixphnnr.replace(/^000/,'');
fixphnnr = fixphnnr.replace(/^\+0/,'+32');
fixphnnr = fixphnnr.replace(/^047/,'+3247');
fixphnnr = fixphnnr.replace(/^048/,'+3248');
fixphnnr = fixphnnr.replace(/^049/,'+3249');
fixphnnr = fixphnnr.replace(/^0032/,'+32');
fixphnnr = fixphnnr.replace(/^32/,'+32');
fixphnnr = fixphnnr.replace(/^0/,'+32');
fixphnnr = fixphnnr.replace(/\s/g,'');
var justnr = fixphnnr.match(re2) || "";
// var justnr = re2.exec(fixphnnr);
console.log('#=#=', phnnr , fixphnnr , justnr.join('') ) ;
if ( justnr.length > 9 && justnr.length < 13 && fixphnnr.substring(1, 0) === '+' ) {
console.log('#=#= is phn ', phnnr, fixphnnr );
return " <a class='phnlnk1' title='Call number: " + fixphnnr + "' href=\"tel:" + fixphnnr + "\"><img class='phncl' width=14 height=14 src='images/mobile/phone.gifx'/></a> <span class='telclr'>" + phnnr + "</span> ";
// onclick=\"return false;\"
} else {
console.log('#=#= not phn ', phnnr, fixphnnr );
// return "<span class='telclr'>" + phnnr + "</span>";
}
}
return fixnr(match);
});
});
});
};
jQuery.fn.highlight = function (str) {
var regex = new RegExp(str, "gi");
return this.each(function () {
$(this).contents().filter(function() {
return this.nodeType == 3 && regex.test(this.nodeValue);
}).replaceWith(function() {
return (this.nodeValue || "").replace(regex, function(match) {
return "<span style='color:#00f;'>" + match + "</span>";
});
});
});
};
function wanker(tmr1) {
// $('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(1)').css('background-position','right top' ).css('background-repeat','no-repeat').css('background-image','url(https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg)');
// $('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(2)').css('background-position','right bottom').css('background-repeat','no-repeat').css('background-image','url(https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg)');
console.log('#=#= wanker start');
setTimeout( function() {
if ( Math.floor(Math.random()*(10)) > 5 ) {
$('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(1)').css('background-position','right top' ).css('background-repeat','no-repeat').css('background-image','url(https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg)');
} else {
$('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(2)').css('background-position','right bottom').css('background-repeat','no-repeat').css('background-image','url(https://s-media-cache-ak0.pinimg.com/originals/21/05/6f/21056fa0930015a43118d54ac3d10646.jpg)');
}
setTimeout( function() {
$('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(1)').css('background-image','none')
$('table.wide > tbody:nth-child(1) > tr:nth-child(2) > td.vsplit:nth-child(2)').css('background-image','none')
}, 10000 );
}, tmr1 * 1000);
console.log('#=#= wanker done');
}
function hop(obj) { // Just here for debugging objects
var msg ='name:\t' + obj.nodeName +
'\nid:\t' + obj.id +
'\nnodetype:\t' + obj.nodeType +
'\nval:\t' + obj.nodeValue +
'\ntagName:\t' + obj.tagName +
'\nnodes:\t' + obj.length;
return msg;
}
// ==============================================================================================================================================================
}
// ==============================================================================================================================================================
function setcolors(bgcolor,txtcolor) {
if ( window.location.href.indexOf('service-now.com') > -1 ) {
console.log('# Setting colors');
$('.label').removeClass('label').addClass('label_');
$('.header').removeClass('header').addClass('label_');
$('.wideDataList').removeClass('wideDataList');
$('.list_odd' ).css('opacity','0.8').find('td').css('background-color','transparant').css('color',txtcolor);
$('.list_even').css('opacity','0.8').find('td').css('background-color','transparant').css('color',txtcolor);
GM_addStyle(' table { background-color:' + bgcolor + '; }');
GM_addStyle(' body { background-color:' + bgcolor + '; }');
GM_addStyle(' iframe { background-color:' + bgcolor + '; }');
GM_addStyle(' .label { background-color:' + bgcolor + '; }');
GM_addStyle(' .label_ { background-color:' + bgcolor + '; }');
GM_addStyle(' .navpage_header_controls { background-color:' + bgcolor + '; }');
GM_addStyle(' td.label { background-color:transparant; }');
GM_addStyle(' td.label_left { background-color:transparant; }');
GM_addStyle(' td.label_right { background-color:transparant; }');
GM_addStyle(' .tabs2_strip { background-color:transparant; }');
GM_addStyle(' tr.header { background-color:transparant; }');
GM_addStyle(' body { color:' + txtcolor + '; }');
// GM_addStyle(' input { color:' + txtcolor + ' !important; }');
// GM_addStyle(' select { color:' + txtcolor + ' !important; }');
GM_addStyle(' label { color:' + txtcolor + '; }');
GM_addStyle(' table { color:' + txtcolor + '; }');
GM_addStyle(' li { color:' + txtcolor + '; }');
GM_addStyle(' .vt { color:' + txtcolor + '; }');
GM_addStyle(' .list2_body { color:' + txtcolor + '; }');
$('tr#banner_row').removeAttr('id');
// $('div#edge_west_inner').removeAttr('id');
$('.list_nav').removeClass('list_nav');
if ( window.location.href.indexOf('navpage.do') > -1 || window.location.href.slice(-1) === '/' ) { $('div').css('background-color', 'transparent'); }
}
}
// console.log('# infobox' $('tr#element\\.' + script + '\\.u_contract').next().find('div.info_box').text() );
// #bf1d96e3c0a801640190725e63f8ac80 > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(9) > td:nth-child(1) > div:nth-child(1)
// userObject.setHomePages('
// My Homepagexyzzyx094ce8706f2852c43ef951dc5d3ee429^
// ------------xyzzyx^
// Employee Self Servicexyzzyx2e7e1042ac1d78807625e81afeac9bd9^
// Managed Services - Self Servicexyzzyxf3d579f02b4eb4484068c1cfe8da153e^
// IT Europe Service Desk Combinedxyzzyx4ef2e5b30ff531c0991ffc5ce1050eec^
// GIS - Change Dashboardxyzzyx9f3513940f46464c991ffc5ce1050e30^
// EU Service Queuesxyzzyx21a577e30a0a3c250121762a4df49ce9^
// My Groups Operations Dashboardxyzzyxd62b8a340a0a3c0829d804c6112fedaa^
// EU SDMs pagexyzzyx998baaec0a0a3c07011c700982bac113^
// My Domain Operations Dashboardxyzzyxd81728310a0a3c0811a853ceff93168b^
// GSOA Management dashboardxyzzyxaee8bfc4ad0d98c014215d055645a180^
// Group IS Forward Schedule of Changesxyzzyxdd2d5ab860d04d044068fbc5843d0a1c^
// EU My Groups Service Queuexyzzyx7d7409ca0a0a3c2500623a93e7d73cae^
// EU Service Desk Management Viewxyzzyx15bece780a0a3c780183eb6f211a41de^
// EU Monitoring Dashboardxyzzyxe81b6ca60a0a3c780172e1a7bcaada46^
// Top Searchesxyzzyxa503826107230000e8735720e1021e1f^
// AM.Platforms Forward Schedule of Changexyzzyxed65cfe32b4945407db0ae9f59da1557^
// AP – SAP Service Desk Dashboardxyzzyx93ed8ece2bb0c988c74a3dc417da156c^
// Cisco TPM Dashboardxyzzyx4f32a6aa0a0a3c2501780bc35379996e^
// EU BS Support Dashbaordxyzzyxa73d82512bdef44c4068c1cfe8da155b^
// EU FSOxyzzyxd37c585d2b864d407db0ae9f59da1503^
// EU GSC Monitoringxyzzyx3ab6b9536fe2c1401f9a5ebd5d3ee448^EU GSC Monitoring - APxyzzyx4d03dc352bb20988c82cae9f59da15ee^EU GSC Monitoring - BENOCxyzzyx7fc31acf0f8306c4c0bff18362050e45^EU GSC Monitoring - DENOCxyzzyxc639e1bb0f6371807ca9f18362050ec2^EU GSC Monitoring - EUxyzzyxf67058b92b720988c82cae9f59da1501^EU GSC Service Deskxyzzyx9a7440da6fe1c6c41f9a5ebd5d3ee409^EU S2A Go-Live Support Dashboardxyzzyxad7d78210f7be900c0bff18362050ee9^EU SCT Dashboardxyzzyx17a6e1e67c2e5dcc7b8c72a627403e14^EU Transition Dashboardxyzzyxbd67b6e26ffa3d846c265ebd5d3ee488^EU TRG Dashboardxyzzyx9f68d186cce0b0409027f8157750100e^GIS - ITaaS Billingxyzzyx4555c2100fa912c8600b83dce1050ef3^GIS Operations Commitments xyzzyxb1aa61850f6d1a88990f55d003050e22^Group IS - Business Applicationxyzzyx82555eb22b83fc404068c1cfe8da155b^Group IS - Change Dashboardxyzzyx5430ead12b733800557bc1cfe8da15de^Group IS - Direct Active Change requestsxyzzyx53c079162bb2340c38a63dc417da15fe^Group IS - Direct Management Dashboardxyzzyx2caac79e2bbb7840557bc1cfe8da15c8^Group IS - Direct Support Dashboardxyzzyxa2fff15f2bdbf4c038a63dc417da1522^Group IS - Direct Support Dashboard - AMxyzzyxae2940232c677c00e591422e7b110f7e^Group IS - Direct Support Dashboard - APxyzzyxdca9a8ef2ca3bc00e591422e7b110fc6^Group IS - Direct Support Dashboard - AppDevxyzzyx8152af0175744588e59164152af191d3^Group IS - Direct Support Dashboard - B2Bxyzzyxb972e74175744588e59164152af191a1^Group IS - Direct Support Dashboard - BAxyzzyxb7236b0575744588e59164152af19101^Group IS - Direct Support Dashboard - EUxyzzyx9f56dc2f2cab7c00e591422e7b110fc8^Group IS - Direct Support Dashboard - MEAxyzzyx12be68232ca7bc00e591422e7b110f0b^Group IS - Direct Support Dashboard - QAxyzzyx8f73331575700988e59164152af191b9^Group IS - Global InfoSec Supportxyzzyxdbadc4340f6271045305cfbce1050e81^Group IS - ITaaS Billingxyzzyx1c448bd86f2592c83ef951dc5d3ee417^Group IS - Operations Dashboardxyzzyxe94eee022b1009443126c1cfe8da1567^Group IS - Salesforce.com Changesxyzzyxbcd5165d2b3ff400557bc1cfe8da15f0^Group IS - SAP Release Dashboardxyzzyx4fcd0fa16fba8d806c265ebd5d3ee421^Group IS - SAP Statistical Dashboardxyzzyx45defdc70f78de40990f55d003050eed^Group IS - SAP Support Dashboardxyzzyx6dc91f4b0f4e3dc0991ffc5ce1050e4d^Group IS - Support Services Dashboardxyzzyxe23da10eecda99407db0e688f04eb332^Group IS – Direct Changesxyzzyxbae41e212bac0108c74a3dc417da156a^Group IS – SAP GT Changesxyzzyxf02a02ba2bcfbc404068c1cfe8da1540^Group PMO - Consulting & Professional Services Portfolio Dashboardxyzzyx01e9cff52b080104557bc1cfe8da15b8^Group PMO - Executive Project Portfolio Dashboardxyzzyxcf010f072bd581040221782f59da1549^Group PMO - Information Services Project Portfolio Dashboardxyzzyxc4a0c7832bd581040221782f59da15d2^Group PMO - Managed Services Portfolioxyzzyxf910cfcf2b9581040221782f59da1564^Group PMO - Simplify to Accelerate Executive Dashboardxyzzyxc88e4b3e2bc0cd04557bc1cfe8da1553^GSC SCOM Afterhours Dashboardxyzzyxf8e517086fda7504b4785ebd5d3ee4c3^GSC SCOM DAY Dashboardxyzzyx7a53d3c06fda7504b4785ebd5d3ee453^IEU Facilities DExyzzyx42801f6f2b018940b478ae9f59da15ad^IEU Facilities NLxyzzyxec2ea1826fcba9403ef981dc5d3ee4f4^IEU Facilities UKxyzzyx79f013ef2b018940b478ae9f59da15d2^ITIL Homepagexyzzyx57ca32420fa28240991ffc5ce1050e12^MEA ITS Campus Facilities Dashboardxyzzyx20d7a56d6fd745081f9a5ebd5d3ee4bd^MEA ITS Service Desk Dashboardxyzzyxc5fa65910ff2c280991ffc5ce1050e71^MSDC Integration Dashboardxyzzyx799d1d686fb1c648b4785ebd5d3ee456^MSDC SLA Lead Indicatorxyzzyx26d0ec2b6fed86486c265ebd5d3ee4d7^NZ-DaaS-Eventxyzzyx20c123b90f805a80418ff18362050e57^SMSO Homepagexyzzyx548a71540fe1120ccab783dce1050ea2');
//