Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkSurveyOfContacts() {
- if (thisObj.interactionData.category === 'umbrella') {
- if (isClientContactSurveyEditable()) {
- resolveSurveyEditableCase();
- thisObj.isSendSurveyLastStateEnabled = true;
- } else {
- setSurveyToNotEditableCase();
- thisObj.isSendSurveyLastStateEnabled = false
- }
- }
- }
- function isClientContactSurveyEditable() {
- if (isOutcomeEqualToSpecificStatus(OUTCOME_COMPLETED)) {
- if (isInteractionTypeEqualToSpecificType(TYPE_ANALYST_CONSULTATION)) {
- if (isProduct_EVP_MVP_GITA_IRS_IEP()) {
- return true;
- }
- } else if (isInteractionTypeEqualToSpecificType(TYPE_BENCHMARK)
- && isInteractionPurposeEqualToSpecificPurpose(PURPOSE_DEAL_REVIEW)
- && isProductSAS()) {
- return true;
- }
- }
- return false;
- }
- function resolveSurveyEditableCase() {
- if(thisObj.isSendSurveyLastStateEnabled){
- return;
- }
- angular.forEach(thisObj.interactionData.clientContacts, function (item, i) {
- if (item.email && item.email.length > 0) {
- item.survey = true;
- item.disabledSurvey = false;
- } else {
- thisObj.contactEmailChanged(item);
- }
- });
- thisObj.interactionData.doNotSendSurvey = false;
- }
- function setSurveyToNotEditableCase() {
- angular.forEach(thisObj.interactionData.clientContacts, function (item, i) {
- item.survey = false;
- item.disabledSurvey = true;
- });
- thisObj.interactionData.doNotSendSurvey = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement