Skip to content

Commit

Permalink
Fixes #65: Update error handling and add phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
lschaefer-sugarcrm committed Jun 27, 2018
1 parent 0531c7f commit a34a0b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 11 additions & 8 deletions package/src/custom/online_application_form/ApplyOnline.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,20 @@ <h1>Application for Admission</h1>
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
if(xhr.responseText) {
document.getElementById('WebToLeadForm').action = urlBase + "//index.php?entryPoint=WebToLeadCapture";

document.getElementById('WebToLeadForm').action = urlBase + "//index.php?entryPoint=WebToLeadCapture";
document.getElementById('campaign_id').value = xhr.responseText;

document.getElementById('campaign_id').value = xhr.responseText;
document.getElementById('redirect_url').value = urlBase + "/custom/online_application_form/ApplyOnlineSuccess.html";

document.getElementById('redirect_url').value = urlBase + "/custom/online_application_form/ApplyOnlineSuccess.html";

if(typeof(validateCaptchaAndSubmit)!='undefined'){
validateCaptchaAndSubmit();
}else{
check_webtolead_fields();
if (typeof(validateCaptchaAndSubmit) != 'undefined') {
validateCaptchaAndSubmit();
} else {
check_webtolead_fields();
}
} else {
alert('We were unable to process your request, because we could not find a Campaign in Sugar with the name Online Applications.');
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function getOnlineApplicationsCampaignId(): string

/**
* Get Sugar Query.
* This function exists so we can mock the SugarQuery in automated tests.
*
* @return \SugarQuery
*/
Expand All @@ -49,7 +50,8 @@ protected function getSugarQuery()
}

/**
* Get a new Campaign Bean
* Get a new Campaign Bean.
* This function exists so we can mock the Campaigns Bean in automated tests.
*
* @return null|\SugarBean
*/
Expand Down

0 comments on commit a34a0b4

Please sign in to comment.