script_includes
Differences
This shows you the differences between two versions of the page.
| script_includes [12/30/2024 06:48] – created johnsonjohn | script_includes [12/31/2025 05:41] (current) – removed johnsonjohn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | =====Script Includes===== | ||
| - | ---- | ||
| - | ====SP Entry Page ==== | ||
| - | < | ||
| - | /** | ||
| - | * | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | * functions can return a path or null if no overrides are necessary | ||
| - | | ||
| - | **/ | ||
| - | var SPEntryPage = Class.create(); | ||
| - | |||
| - | SPEntryPage.prototype = { | ||
| - | |||
| - | initialize: | ||
| - | this.logVariables = false; | ||
| - | this.portal = "/ | ||
| - | }, | ||
| - | |||
| - | /*** | ||
| - | * | ||
| - | * Referred to by property: glide.entry.page.script | ||
| - | * | ||
| - | **/ | ||
| - | getLoginURL: | ||
| - | // When requesting a page directly (eg: / | ||
| - | // The platform session_timeout.do sets the login page to welcome.do | ||
| - | // Since we are handling the login, clear that value | ||
| - | var session = gs.getSession(); | ||
| - | var nt = session.getProperty(" | ||
| - | var sPage = session.getProperty(" | ||
| - | if (nt == " | ||
| - | session.clearProperty(" | ||
| - | |||
| - | if (!sPage && !nt) | ||
| - | session.putProperty(" | ||
| - | |||
| - | // Send the user to the portal' | ||
| - | var portalGR = new GlideRecord(" | ||
| - | portalGR.addQuery(" | ||
| - | portalGR.addNotNullQuery(" | ||
| - | portalGR.query(); | ||
| - | if (portalGR.next()) | ||
| - | return this.portal + "? | ||
| - | |||
| - | // Send to the a default login page | ||
| - | return this.portal + "? | ||
| - | }, | ||
| - | |||
| - | /*** | ||
| - | * | ||
| - | * Referred to by property: glide.entry.first.page.script | ||
| - | * | ||
| - | **/ | ||
| - | getFirstPageURL: | ||
| - | var session = gs.getSession(); | ||
| - | this.logProperties(' | ||
| - | |||
| - | // has roles and is not a Service Portal page - go to UI16 | ||
| - | var nt = session.getProperty(" | ||
| - | var isServicePortalURL = new GlideSPScriptable().isServicePortalURL(nt); | ||
| - | var redirectURL = session.getProperty(" | ||
| - | |||
| - | //if (user.hasRoles() && !redirectURL && !isServicePortalURL) | ||
| - | //Greg modified on 10/3/19 | ||
| - | //if (user.hasRole(" | ||
| - | //Greg modified this again on 6/16/20 | ||
| - | if ((user.hasRole(" | ||
| - | return; | ||
| - | |||
| - | // user may have logged in from a frame, the / | ||
| - | if (!redirectURL) { | ||
| - | // redirectURL is nav_to | ||
| - | // if nav_to == " | ||
| - | var sPage = session.getProperty(" | ||
| - | if (sPage && nt == " | ||
| - | nt = sPage; | ||
| - | |||
| - | // Avoid a redirect loop to the home page | ||
| - | var ep = gs.getProperty(" | ||
| - | if (nt) { | ||
| - | if (ep == nt) | ||
| - | nt = null; | ||
| - | } | ||
| - | // PRB726860: if page is still welcome.do, go to glide.login.home preserving frameset | ||
| - | if (nt == " | ||
| - | session.putProperty(" | ||
| - | return; | ||
| - | } | ||
| - | |||
| - | session.putProperty(" | ||
| - | return "/ | ||
| - | } | ||
| - | |||
| - | session.clearProperty(" | ||
| - | var returnUrl = this.portal; | ||
| - | if (redirectURL && redirectURL != " | ||
| - | var spUrl = new GlideSPScriptable().mapUrlToSPUrl(redirectURL); | ||
| - | returnUrl = spUrl ? this.portal + "?" | ||
| - | } | ||
| - | |||
| - | this.logProperties(' | ||
| - | if (!this.logVariables) { | ||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | } | ||
| - | |||
| - | return returnUrl; | ||
| - | }, | ||
| - | |||
| - | logProperties: | ||
| - | if (!this.logVariables) | ||
| - | return; | ||
| - | |||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | gs.log(' | ||
| - | }, | ||
| - | |||
| - | type: ' | ||
| - | }; | ||
| - | </ | ||
| - | ---- | ||
| - | |||
| - | ====ThedaCare Utils Prod ==== | ||
| - | < | ||
| - | var thedaCareUtils = Class.create(); | ||
| - | thedaCareUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, | ||
| - | |||
| - | /*Function to get all the members of ' | ||
| - | |||
| - | getMembers: function() { | ||
| - | var gr = new GlideRecord(' | ||
| - | gr.addQuery(' | ||
| - | gr.query(); | ||
| - | var userArr = []; | ||
| - | while (gr.next()) { | ||
| - | userArr.push(gr.getValue(" | ||
| - | } | ||
| - | return ' | ||
| - | }, | ||
| - | type: ' | ||
| - | }); | ||
| - | </ | ||
| - | ---- | ||
script_includes.1735570123.txt.gz · Last modified: by johnsonjohn
