Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

//attempt call without ajax. Ajax can have issues with binary returns.
var req = new XMLHttpRequest();
req.open("POST", app.getSharedData().FillPdfUrl, true);
req.responseType = "blob";
req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
req.onload = function (event) {
var blob = req.response;
var link=document.createElement('a');
link.href=window.URL.createObjectURL(blob);
link.download= "PaymentStatusReport" + "_" + obj.companyName + "_" + obj.monthEnding +".pdf";
link.click();
}
req.send(beanJSON);


}


//load external css
dojo.require("dojo.NodeList-manipulate");
dojo.ready(function(){
dojo.query("head").append('<link href="https://media.feb.uconn.edu/base/uconn-leap-style-92.min.css" rel="stylesheet" type="text/css">');
});

//load uconn cookie js
dojo.require("dojo.io.script");
dojo.ready(function() {
dojo.io.script.get({
url: "https://scripts-universityofconn.netdna-ssl.com/cookie-notification.js"
})
});

app.getSharedData().showOkDialogBox = function(title,content) {
require(["dijit/Dialog", "dijit/form/Button", "dojo/domReady!"], function (Dialog,Button) {
var okButton = new Button({ label: "OK" });
okButton.setAttribute('style', 'margin-left:370px;margin-top:10px;');
okButton.setAttribute('tabindex', '1');
okButton.startup();
genDialog = new Dialog({
title : title,
content : content,
style : "width: 470px;font-size:11pt;"
});
okButton.placeAt(genDialog);
okButton.on("click", function(event) {
genDialog.hide();
});
});
genDialog.show();
}

app.getSharedData().restUrls = {
"baseInfo": {"protocol":window.location.protocol,"host":window.location.host,"format":"json","appId":app.getUID(),"contextRoot":app.getSharedData().RegionUtils.contextRoot()},
"addCertifiedCompany": function(params) {
var template = "{protocol}//{host}/{contextRoot}/secure/org/data/{appId}/F_CertifiedCompany?format=application/{format}&freedomIdentifyKey={freedomIdentifyKey}";
return app.getSharedData().StringUtils.stringFormat(template, $.extend(params,this.baseInfo));
}
}

app.getSharedData().getDasCodeByDasText = function(dasText) {
var tVal = dasText.replace(/\s+/g,"");
if (tVal === "MBE" || tVal === "MBENone") return "MBE";
if (tVal === "SBE" || tVal === "SBENone") return "SBE";
var map = {
"AmericanIndian":"N",
"AmericanIndianDisabled":"DN",
"AmericanIndianWoman":"NW",
"AmericanIndianWomanDisabled":"DNW",
"AsianPacificAmericanandPacificIslander":"A",
"AsianPacificAmericanandPacificIslanderDisabled":"DA",
"AsianPacificAmericanandPacificIslanderWoman":"AW",
"AsianPacificAmericanandPacificIslanderWomanDisabled":"DAW",
"BlackAmerican":"B",
"BlackAmericanDisabled":"DB",
"BlackAmericanWoman":"BW",
"BlackAmericanWomanDisabled":"DBW",
"HispanicAmerican":"H",
"HispanicAmericanDisabled":"DH",
"HispanicAmericanWoman":"HW",
"HispanicAmericanWomanDisabled":"DHW",
"IberianPeninsula":"I",
"IberianPeninsulaDisabled":"DI",
"IberianPeninsulaWoman":"IW",
"IberianPeninsulaWomanDisabled":"DIW",
"Disabled":"D",
"Woman":"W",
"WomanAsian":"AW",
"WomanDisabled":"DW"
}
var value = map[tVal.substring(3)];
if (value !== "") return value;
if (value === "") return "?";
};

app.getSharedData().createYearSelectOptions = function(year,floor,ceil,isDesc=0) {
var options = [];
for (var i = year - floor; i <= year + ceil; i++) {
options.push({title:i,value:i});
}
if (isDesc) {
options.sort(function(a,b) {
return a.title + b.title;
})
}
return options;
}


/* onClick of Button for PDF download */

BO.F_CheckBox1.setValue(true);

app.getSharedData().downloadPdfConfirm();

var monthEnding = BO.F_MonthEndCalYear.getValue();
var companyName = BO.F_ContractorName.getValue();
var projectName = BO.F_ProjectName.getValue();
var awardingAgencyName = BO.F_ContractAwardAgency.getValue();
var projectNumber = BO.F_ProjectNumber.getValue();
var smbe = BO.F_VendorCertClass.getValue();
var mobilizationDate = BO.F_MobilizationDate.getValue();
var projectValue = BO.F_ProjectValue.getValue();
var percentComplete = BO.F_PercentCompleteToDate.getValue();
var finalReport = BO.F_IsFinalReport.getValue();
var completionDate = BO.F_EstCompletionDate.getValue();
var reportEntryDate = BO.F_ReportEntryDate.getValue();
var printedAuthorizedSignature = BO.F_SignerName.getValue();
var smbeTableAsText = BO.F_SmbeTableAsText.getValue();

//errors with these 2 rows
var result = app.getSharedData().FillPdf();
//var json_obj = JSON.parse(result);

/*
//From returning LDAP search, not sure if parts of this need to be used
var tbl = BO.F_firstlastsrchresults;
tbl.setValue(new Array()); //clear table

for (var i = 0; i < json_obj.length; i++){
var row = json_obj[i];
var person = app.getSharedData().LdapSearchByCriteriaResult();
person.initializeData(row);

var newRow = tbl.createNew();
// var newCols = newRow.getChildren();

get(newRow, 'F_srchfirstname').setValue(person.firstName);
get(newRow, 'F_SrchLastname').setValue(person.lastName);
get(newRow, 'F_Srchtblenetid').setValue(person.netId);
get(newRow, 'F_srchtblorg').setValue(person.deptName);
get(newRow, 'F_srchtblemail').setValue(person.email);
get(newRow, 'F_srchtblphone').setValue(person.phoneNumber);

//newCols.get(0).setValue(person.firstName);
//newCols.get(1).setValue(person.lastName);
//newCols.get(2).setValue(person.netId);
//newCols.get(3).setValue(person.deptName);
//newCols.get(4).setValue(person.email);
//newCols.get(5).setValue(person.phoneNumber);

tbl.add(newRow);

}
*/