From c4f2839700d5969470548d088c1ac2fedf81932a Mon Sep 17 00:00:00 2001 From: Zachary Morello <32403871+z99o@users.noreply.github.com> Date: Thu, 14 Nov 2019 23:54:45 -0800 Subject: [PATCH 01/13] Create Duo Reactivation Ticket Button on Reftool.js I have been making duo phone reactivation tickets more than using phone@log so I felt that this might fit well --- Duo Reactivation Ticket Button on Reftool.js | 70 ++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Duo Reactivation Ticket Button on Reftool.js diff --git a/Duo Reactivation Ticket Button on Reftool.js b/Duo Reactivation Ticket Button on Reftool.js new file mode 100644 index 0000000..4cea29b --- /dev/null +++ b/Duo Reactivation Ticket Button on Reftool.js @@ -0,0 +1,70 @@ +// ==UserScript== +// @name Duo Reactivation Ticket Button on Reftool +// @namespace http://tampermonkey.net/ +// @version 1.0 +// @description Adds a button to create a new duo reactivation ticket with the appropriate fields filled out +// @author Zachary Morello +// @match https://tools.is.oregonstate.edu/reftool2/* +// @match https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=39063&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/duo-reactivation +// @grant none +// ==/UserScript== + +var URL = window.location.href; +if(URL.indexOf("tools.is.oregonstate.edu/reftool2/") >=0){ + window.setTimeout(put_button, 750); +} +else if(URL.indexOf("&/duo-reactivation") >=0){ + window.setTimeout(fill_form_duo_reactivation, 500); +} + +function fill_form_duo_reactivation(){ + //var form = document.getElementById("select2-chosen-11"); + //form.innerText = "Duo Support"; + //var groups = form.getElementsByTagName("optgroup"); + //groups[4].setAttribute("selected","selected"); + var status = document.getElementById("attribute1306"); + status = status.children; + for(var i=0; i Date: Fri, 15 Nov 2019 11:18:55 -0800 Subject: [PATCH 02/13] Duo Support Item Checked To prevent confusion the duo support item will show that it's true --- Duo Reactivation Ticket Button on Reftool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Duo Reactivation Ticket Button on Reftool.js b/Duo Reactivation Ticket Button on Reftool.js index 4cea29b..1fcc9aa 100644 --- a/Duo Reactivation Ticket Button on Reftool.js +++ b/Duo Reactivation Ticket Button on Reftool.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Duo Reactivation Ticket Button on Reftool // @namespace http://tampermonkey.net/ -// @version 1.0 +// @version 1.1 // @description Adds a button to create a new duo reactivation ticket with the appropriate fields filled out // @author Zachary Morello // @match https://tools.is.oregonstate.edu/reftool2/* @@ -43,6 +43,8 @@ function fill_form_duo_reactivation(){ technotes.innerText = "Instructed customer to go to duo.oregonstate.edu, had them click 'reactivate device' and walked them through the reactivation process"; var duosupportitem = document.getElementById("attribute74632Choice183929"); duosupportitem.value = "true"; + //Support item is still valid but to prevent confusion I set it to be visually checked + duosupportitem.checked =true; } function put_button(){ From a14c30a517e8baf723ebdfc74e78bfc110e8d353 Mon Sep 17 00:00:00 2001 From: Zachary Morello <32403871+z99o@users.noreply.github.com> Date: Fri, 15 Nov 2019 11:20:56 -0800 Subject: [PATCH 03/13] Rename for tampermonkey compatability *.user.js allows tampermonkey to recognize that this is a valid script --- ...eftool.js => Duo Reactivation Ticket Button on Reftool.user.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Duo Reactivation Ticket Button on Reftool.js => Duo Reactivation Ticket Button on Reftool.user.js (100%) diff --git a/Duo Reactivation Ticket Button on Reftool.js b/Duo Reactivation Ticket Button on Reftool.user.js similarity index 100% rename from Duo Reactivation Ticket Button on Reftool.js rename to Duo Reactivation Ticket Button on Reftool.user.js From 11e4b573c0be10dc245fe320506d30e8a043b216 Mon Sep 17 00:00:00 2001 From: Zachary Morello <32403871+z99o@users.noreply.github.com> Date: Fri, 15 Nov 2019 15:32:30 -0800 Subject: [PATCH 04/13] 2.0 : Pulls UID from reftool search -By default the requester will be Phone@Log -If you have viewed a reftool profile, it will pull the UID from the most recently viewed profile -Script now waits twice as long for the page to load to avoid load errors that result in no loading --- ...ctivation Ticket Button on Reftool.user.js | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/Duo Reactivation Ticket Button on Reftool.user.js b/Duo Reactivation Ticket Button on Reftool.user.js index 1fcc9aa..19a9c89 100644 --- a/Duo Reactivation Ticket Button on Reftool.user.js +++ b/Duo Reactivation Ticket Button on Reftool.user.js @@ -1,22 +1,48 @@ // ==UserScript== // @name Duo Reactivation Ticket Button on Reftool // @namespace http://tampermonkey.net/ -// @version 1.1 +// @version 2.0 // @description Adds a button to create a new duo reactivation ticket with the appropriate fields filled out // @author Zachary Morello // @match https://tools.is.oregonstate.edu/reftool2/* +// @include https://tools.is.oregonstate.edu/reftool2/* // @match https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=39063&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/duo-reactivation +// @include https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=39063* // @grant none // ==/UserScript== +var UID = "de751dc3-eeb7-e611-80cd-000d3a13db68"; var URL = window.location.href; + + if(URL.indexOf("tools.is.oregonstate.edu/reftool2/") >=0){ - window.setTimeout(put_button, 750); + try{ + window.setTimeout(put_button, 1500); + } + catch(TypeError){ + window.setTimeout(put_button, 1500); + } + } else if(URL.indexOf("&/duo-reactivation") >=0){ window.setTimeout(fill_form_duo_reactivation, 500); } +setInterval(ScanForUID,50); + +function ScanForUID(){ + if(document.getElementById("account-details") != null) { + var open_tickets = document.getElementById("goto-tickets"); + var parent = open_tickets.parentNode; + var href = parent.children[2].href; + console.log("UID = ",href.split("UID=")[1]); + UID = href.split("UID=")[1]; + + } +} + + + function fill_form_duo_reactivation(){ //var form = document.getElementById("select2-chosen-11"); //form.innerText = "Duo Support"; @@ -46,8 +72,8 @@ function fill_form_duo_reactivation(){ //Support item is still valid but to prevent confusion I set it to be visually checked duosupportitem.checked =true; } - function put_button(){ + //await(100); var search = document.getElementById("search"); // 1. Create the button @@ -65,7 +91,7 @@ function put_button(){ // Function that handles click of form button function click_reactivation_button(){ - var url = "https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=39063&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/duo-reactivation"; + var url = "https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=39063&RequestorUID="+UID+"&/duo-reactivation"; window.open(url, '_blank'); } From cbe64ffb00c6607c8da15b4c98f899adfe7b826f Mon Sep 17 00:00:00 2001 From: Zachary Morello <32403871+z99o@users.noreply.github.com> Date: Fri, 15 Nov 2019 15:37:29 -0800 Subject: [PATCH 05/13] Increased Button Wait Time The function to place a button onto the page was too fast and oftentimes would fail to load because the element it was appended to would not exist yet --- Phone@log Button on Reftool.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Phone@log Button on Reftool.user.js b/Phone@log Button on Reftool.user.js index d7df309..734897c 100644 --- a/Phone@log Button on Reftool.user.js +++ b/Phone@log Button on Reftool.user.js @@ -1,9 +1,9 @@ // ==UserScript== // @name Phone@log Button on Reftool // @namespace http://tampermonkey.net/ -// @version 1.0 +// @version 1.1 // @description Adds a button to create a new phone@log ticket with the appropriate fields filled out -// @author Luke Miletta +// @author Luke Miletta / v1.1 by Zachary Morello // @match https://tools.is.oregonstate.edu/reftool2/* // @match https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=17631&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/phonelog // @match https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=17631&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/transcripts @@ -12,7 +12,7 @@ var URL = window.location.href; if(URL.indexOf("tools.is.oregonstate.edu/reftool2/") >=0){ - window.setTimeout(put_button, 750); + window.setTimeout(put_button, 1500); } else if(URL.indexOf("&/phonelog") >=0){ window.setTimeout(fill_form_generic, 500); @@ -99,3 +99,4 @@ function put_button(){ window.open(url, '_blank'); } } + From b6eb71e624428de9638c24f50f9d7063b10fff12 Mon Sep 17 00:00:00 2001 From: Zachary Morello <32403871+z99o@users.noreply.github.com> Date: Fri, 15 Nov 2019 15:44:27 -0800 Subject: [PATCH 06/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f46ee02..7397fb0 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# TD-Scripts created by Luke Miletta and Tyler Farnham +# TD-Scripts created by Luke Miletta, Tyler Farnham and Zachary Morello From 7dc09bc8a1d90b9c2f651b7d069276bf7345791b Mon Sep 17 00:00:00 2001 From: Zachary Morello <32403871+z99o@users.noreply.github.com> Date: Mon, 17 Feb 2020 16:27:32 -0800 Subject: [PATCH 07/13] No longer need to check and uncheck box --- ...ctivation Ticket Button on Reftool.user.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Duo Reactivation Ticket Button on Reftool.user.js b/Duo Reactivation Ticket Button on Reftool.user.js index 19a9c89..5013d98 100644 --- a/Duo Reactivation Ticket Button on Reftool.user.js +++ b/Duo Reactivation Ticket Button on Reftool.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Duo Reactivation Ticket Button on Reftool // @namespace http://tampermonkey.net/ -// @version 2.0 +// @version 2.0.1 // @description Adds a button to create a new duo reactivation ticket with the appropriate fields filled out // @author Zachary Morello // @match https://tools.is.oregonstate.edu/reftool2/* @@ -27,9 +27,12 @@ if(URL.indexOf("tools.is.oregonstate.edu/reftool2/") >=0){ else if(URL.indexOf("&/duo-reactivation") >=0){ window.setTimeout(fill_form_duo_reactivation, 500); } - +//Search for UID every 0.5 seconds setInterval(ScanForUID,50); +/* +***Finds the User ID for the currently searched person +*/ function ScanForUID(){ if(document.getElementById("account-details") != null) { var open_tickets = document.getElementById("goto-tickets"); @@ -44,10 +47,6 @@ function ScanForUID(){ function fill_form_duo_reactivation(){ - //var form = document.getElementById("select2-chosen-11"); - //form.innerText = "Duo Support"; - //var groups = form.getElementsByTagName("optgroup"); - //groups[4].setAttribute("selected","selected"); var status = document.getElementById("attribute1306"); status = status.children; for(var i=0; i Date: Thu, 28 May 2020 13:24:48 -0700 Subject: [PATCH 08/13] Automatically Select Service Offering --- Phone@log Button on Reftool.user.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Phone@log Button on Reftool.user.js b/Phone@log Button on Reftool.user.js index 734897c..7b122f6 100644 --- a/Phone@log Button on Reftool.user.js +++ b/Phone@log Button on Reftool.user.js @@ -39,6 +39,8 @@ function fill_form_transcripts(){ title.value = "Transcripts Request"; var body = document.getElementById("attribute2937"); body.innerText = "Someone called asking about transcripts. They are a previous student and forgot their ID number. We referred them to the Office of the Registrar."; + + } function fill_form_generic(){ @@ -55,6 +57,15 @@ function fill_form_generic(){ by = by.children; by[0].setAttribute("value", "793"); by[0].innerText = "Phone"; + + var othersupportitem = document.getElementById("attribute38159Choice90187"); + //It's hard to tell which one of these operations actually does what I need it to do so I did all of them at once + othersupportitem.value = "true"; + //Support item is still valid but to prevent confusion I set it to be visually checked + othersupportitem.checked =true; + //call the "onclick" function for the element manually + var click = otherupportitem["onclick"]; + click.call(othersupportitem); } function put_button(){ From 3de89661c5a00b3318ab0e0896f4a7debb6539fa Mon Sep 17 00:00:00 2001 From: z99o <32403871+z99o@users.noreply.github.com> Date: Thu, 28 May 2020 13:25:44 -0700 Subject: [PATCH 09/13] Update Version No. --- Phone@log Button on Reftool.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Phone@log Button on Reftool.user.js b/Phone@log Button on Reftool.user.js index 7b122f6..2d15789 100644 --- a/Phone@log Button on Reftool.user.js +++ b/Phone@log Button on Reftool.user.js @@ -1,9 +1,9 @@ // ==UserScript== // @name Phone@log Button on Reftool // @namespace http://tampermonkey.net/ -// @version 1.1 +// @version 1.2 // @description Adds a button to create a new phone@log ticket with the appropriate fields filled out -// @author Luke Miletta / v1.1 by Zachary Morello +// @author Luke Miletta / v1.2 by Zachary Morello // @match https://tools.is.oregonstate.edu/reftool2/* // @match https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=17631&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/phonelog // @match https://oregonstate.teamdynamix.com/TDNext/Apps/425/Tickets/New?formId=17631&RequestorUID=de751dc3-eeb7-e611-80cd-000d3a13db68&/transcripts From 6975bf75ad4e372ef84b701fea6d4d9a7cd47693 Mon Sep 17 00:00:00 2001 From: z99o <32403871+z99o@users.noreply.github.com> Date: Thu, 28 May 2020 13:34:17 -0700 Subject: [PATCH 10/13] Typo correction and auto toggle fix --- Phone@log Button on Reftool.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Phone@log Button on Reftool.user.js b/Phone@log Button on Reftool.user.js index 2d15789..7c09829 100644 --- a/Phone@log Button on Reftool.user.js +++ b/Phone@log Button on Reftool.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Phone@log Button on Reftool // @namespace http://tampermonkey.net/ -// @version 1.2 +// @version 1.2.1 // @description Adds a button to create a new phone@log ticket with the appropriate fields filled out // @author Luke Miletta / v1.2 by Zachary Morello // @match https://tools.is.oregonstate.edu/reftool2/* @@ -64,7 +64,7 @@ function fill_form_generic(){ //Support item is still valid but to prevent confusion I set it to be visually checked othersupportitem.checked =true; //call the "onclick" function for the element manually - var click = otherupportitem["onclick"]; + var click = othersupportitem["onclick"]; click.call(othersupportitem); } From 9814679ef3fdc86050fd6ab88d5ab5ae57c14bea Mon Sep 17 00:00:00 2001 From: z99o <32403871+z99o@users.noreply.github.com> Date: Thu, 28 May 2020 13:34:35 -0700 Subject: [PATCH 11/13] Update Phone@log Button on Reftool.user.js --- Phone@log Button on Reftool.user.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Phone@log Button on Reftool.user.js b/Phone@log Button on Reftool.user.js index 7c09829..3199267 100644 --- a/Phone@log Button on Reftool.user.js +++ b/Phone@log Button on Reftool.user.js @@ -39,7 +39,14 @@ function fill_form_transcripts(){ title.value = "Transcripts Request"; var body = document.getElementById("attribute2937"); body.innerText = "Someone called asking about transcripts. They are a previous student and forgot their ID number. We referred them to the Office of the Registrar."; - + var othersupportitem = document.getElementById("attribute38159Choice90187"); + //It's hard to tell which one of these operations actually does what I need it to do so I did all of them at once + othersupportitem.value = "true"; + //Support item is still valid but to prevent confusion I set it to be visually checked + othersupportitem.checked =true; + //call the "onclick" function for the element manually + var click = othersupportitem["onclick"]; + click.call(othersupportitem); } @@ -58,14 +65,7 @@ function fill_form_generic(){ by[0].setAttribute("value", "793"); by[0].innerText = "Phone"; - var othersupportitem = document.getElementById("attribute38159Choice90187"); - //It's hard to tell which one of these operations actually does what I need it to do so I did all of them at once - othersupportitem.value = "true"; - //Support item is still valid but to prevent confusion I set it to be visually checked - othersupportitem.checked =true; - //call the "onclick" function for the element manually - var click = othersupportitem["onclick"]; - click.call(othersupportitem); + } function put_button(){ From 66898f9324688faf88e0f3fe27cab05d7895946b Mon Sep 17 00:00:00 2001 From: z99o <32403871+z99o@users.noreply.github.com> Date: Fri, 5 Jun 2020 17:06:07 -0700 Subject: [PATCH 12/13] Exchange Migration Help Ticket Button +Added a generic template for helping users with logging into their exchange mailboxes after their email had migrated --- ...ctivation Ticket Button on Reftool.user.js | 1 - Exchange Migration Help.user.js | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 Exchange Migration Help.user.js diff --git a/Duo Reactivation Ticket Button on Reftool.user.js b/Duo Reactivation Ticket Button on Reftool.user.js index 5013d98..e3c84c6 100644 --- a/Duo Reactivation Ticket Button on Reftool.user.js +++ b/Duo Reactivation Ticket Button on Reftool.user.js @@ -50,7 +50,6 @@ function fill_form_duo_reactivation(){ var status = document.getElementById("attribute1306"); status = status.children; for(var i=0; i=0){ + try{ + window.setTimeout(put_button, 1500); + } + catch(TypeError){ + window.setTimeout(put_button, 1500); + } + +} +else if(URL.indexOf("&/exchange-migration-help") >=0){ + window.setTimeout(fill_ticket_forms, 500); +} +//Search for UID every 0.5 seconds +setInterval(ScanForUID,50); + +/* +***Finds the User ID for the currently searched person +*/ +function ScanForUID(){ + if(document.getElementById("account-details") != null) { + var open_tickets = document.getElementById("goto-tickets"); + var parent = open_tickets.parentNode; + var href = parent.children[2].href; + console.log("UID = ",href.split("UID=")[1]); + UID = href.split("UID=")[1]; + + } +} +/* +Sets the support item checkbox value to true +Attribute and choice are found by inspecting the element of the ticket creation page. +Take note that some creation pages have differant service offering lists, like Duo and Device/Application Support +*/ +function set_support_item(attribute,choice){ + var exchangesupportitem = document.getElementById("attribute"+ attribute + "Choice"+ choice); + //It's hard to tell which one of these operations actually does what I need it to do so I did all of them at once + exchangesupportitem.value = "true"; + //Support item is still valid but to prevent confusion I set it to be visually checked + exchangesupportitem.checked =true; + //call the "onclick" function for the element manually + var click = exchangesupportitem["onclick"]; + click.call(exchangesupportitem); +} + +//You can find a formID by going to the IT tab and looking at the differant urls that open when you open the "+New" dropdown menu +function fill_ticket_forms(){ + var status = document.getElementById("attribute1306"); //closed + status = status.children; + for(var i=0; i Date: Fri, 5 Jun 2020 17:56:26 -0700 Subject: [PATCH 13/13] Bugfixes --- Duo Reactivation Ticket Button on Reftool.user.js | 1 + Exchange Migration Help.user.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Duo Reactivation Ticket Button on Reftool.user.js b/Duo Reactivation Ticket Button on Reftool.user.js index e3c84c6..5013d98 100644 --- a/Duo Reactivation Ticket Button on Reftool.user.js +++ b/Duo Reactivation Ticket Button on Reftool.user.js @@ -50,6 +50,7 @@ function fill_form_duo_reactivation(){ var status = document.getElementById("attribute1306"); status = status.children; for(var i=0; i