Last active
March 8, 2022 10:16
-
-
Save ritacse/20052febf01e10b90505a132e4637319 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Report open from approval system without external Login | |
/// Example from : \DMS\DMS.Planning.Web\Scripts\Planning\YarnAllocation.js | |
function RefFBLink(fbCode, fbVersion) { | |
var ReportName = 'rptFabricBooking.aspx'; | |
var DocBaseID = 63; | |
if (fbCode == 'N/A' || fbCode == null || fbCode =='') | |
toastr.warning("Fabric booknig does not found against this job.",'Invalid'); | |
else { | |
//var urlLink = 'http://localhost:59780/ApprovalSystem/htmlReport/' + ReportName + '?clientAgent=Web&userId=' + 0 + '&docBaseId=' + DocBaseID + '&docCode=' + fbCode + '&docVersion=' + fbVersion; | |
var urlLink = 'http://172.16.1.8/ApprovalSystem/htmlReport/' + ReportName + '?clientAgent=Web&userId=' + 0 + '&docBaseId=' + DocBaseID + '&docCode=' + fbCode + '&docVersion=' + fbVersion; | |
window.open(urlLink); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// send parameter | |
var url = '../ApprovalReportViewer.aspx?docBaseId=' + aData.Doc_Type + "&docCode=" + aData.Code + "&docVersion=" + aData.Version; | |
window.open(url, '_blank'); // <- This is what makes it open in a new window. | |
//Get parameter | |
var docBaseId = $.url().param('docBaseId'); | |
var docCode = $.url().param('docCode'); | |
var docVersion = $.url().param('docVersion'); | |
//Or | |
var docBaseId = GetParameterValues('docBaseId'); | |
var docCode = GetParameterValues('docCode'); | |
var docVersion = GetParameterValues('docVersion'); | |
function GetParameterValues(param) { | |
var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | |
for (var i = 0; i < url.length; i++) { | |
var urlparam = url[i].split('='); | |
if (urlparam[0] == param) { | |
return urlparam[1]; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.location.hostname.indexOf("192") > -1) /// Not provid ethe full link | |
var redirect = 'http://192.168.200.35:5693/ApprovalHRMS/API/ExternalCommunicationHandler.ashx'; | |
else | |
var redirect = 'http://localhost:8222/API/ExternalCommunicationHandler.ashx'; | |
//Tips | |
window.location.host : you'll get sub.domain.com:8080 or sub.domain.com:80 | |
window.location.hostname : you'll get sub.domain.com | |
window.location.protocol : you'll get http: | |
window.location.port : you'll get 8080 or 80 | |
window.location.pathname : you'll get /virtualPath | |
window.location.origin : you'll get http://sub.domain.com ***** | |
//ditect page name | |
var pageName = document.location.pathname.match(/[^\/]+$/)[0]; | |
var pageName2 = location.pathname.split('/').slice(-1)[0]; | |
var href = document.location.href; | |
var lastPathSegment = href.substr(href.lastIndexOf('/') + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = '../../HTMLReports/frmRptKPIEmpWiseAchievementDetails.aspx?EmpId=' + group1[i].EmpId + "&AchieveMonth=" + group1[i].TargetFromMonth + "&AchieveYear=" + group1[i].TargetFromYear; | |
///static | |
<td> <a href="url" target="_blank">A K Shams Noor(1053)</a> </td> | |
///Dynamic | |
'<td style="text-align:center;"><a href="' + url + '" target="_blank">' | |
+ group1[i].EmpNameEng + '(' + group1[i].EmpId + ')' | |
+ '</a></td>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment