(function() { var app = angular.module("bmCore", []); app.filter('entityName', function() { return function (input) { let udf = false; if (input.indexOf('_udf') > -1) { udf = true; input = '$' + '{' + input.split('_udf')[0] + '.value}'; } var _input = input.replaceAll('$' +'{applicant.value}', '') .replaceAll('$' + '{client_contact.value}', '') .replaceAll('$' + '{client_office.value}', '') .replaceAll('$' + '{contact.value}', '') .replaceAll('$' + '{client.value}', '') .replaceAll('$' + '{requirement.value}', '') .replaceAll('$' + '{office.value}', '') .replaceAll('$' + '{submittal.value}', '') .replaceAll('$' + '{placement.value}', '') .replaceAll('$' + '{workgroup.value}', '') ; if (udf) { _input = _input.replace('$').replace('{').replace('}'); } return _input + (udf ? ' UDF' : ''); } }); app.filter('utc', function() { return function(val) { var date = new Date(val); return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0); }; }); app.filter('https', function() { return function(val) { return val.replace('http://', 'https://'); }; }); function getStatusTypes() { return { NONE : { id : -1 }, ACTIVE : { id : 1 }, INACTIVE : { id : 2 }, TOMBSTONE : { id : 3 }, } } function getFilterTypes() { return { REQSTAT : { id : 1 }, SUBSTAT : { id : 2 }, ACTTYPE : { id : 3 }, EMPLTYPE : { id : 4 }, PLACEMENT : { id : 5 }, CONSTAT : { id : 6 }, TASK : { id : 7 }, } } function getSubmittalTemplateTypes() { return { DECLINED : { id : 1, name : 'Declined' }, PLACED : { id : 2, name : 'Placed' }, SUBMITTED : { id : 3, name : 'Submitted' }, OTHER : { id : 4, name : 'Other' }, } } function getDropdownTypes() { return { NONE : { id : -1 }, ACTION_EMAIL : { id : 1 }, ACTION_SUBMITTAL : { id : 2 }, ACTION_MY_APPLICANT_FOLDER : { id : 3 }, ACTION_PUBLIC_APPLICANT_FOLDER : { id : 4 }, ACTION_SENDOUT : { id : 5 }, ACTION_MY_CLIENT_FOLDER : { id : 6 }, ACTION_PUBLIC_CLIENT_FOLDER : { id : 7 }, ACTION_MY_CONTACT_FOLDER : { id : 8 }, ACTION_PUBLIC_CONTACT_FOLDER : { id : 9 }, ACTION_MY_REQUIREMENT_FOLDER : { id : 10 }, ACTION_PUBLIC_REQUIREMENT_FOLDER : { id : 11 }, ACTION_DECLINE_SUBMITTAL : { id : 12 }, ACTION_SEND_TO_CART : { id : 13 }, ACTION_SUBACTIVITY_MASS : { id : 14 }, ACTION_ACTIVITY_MASS : { id : 15 }, ACTION_MASS_DELETE : { id : 56 }, ACTION_TAG_MASS : { id : 55 }, ACTION_DECLINE_SUBMITTAL_NOTE : { id : 16 }, ACTION_SUBMITTAL_EXTENDED : { id : 17 }, ACTION_MASS_REQUIREMENT_STATUS : { id : 18 }, ACTION_ACTIVITY_PLACEMENT_MASS : { id : 19 }, ACTION_SEND_SMS : { id : 20 }, ACTION_ACTIVITY : { id : 21 }, ACTION_EXPORT_CLIENT_OFFICE_REQUIREMENTS : { id : 22 }, ACTION_COPY_REQUIREMENTS : { id : 23 }, ACTION_COPY_REQUIREMENTS_POST_TO_WEB : { id : 24 }, ACTION_COPY_REQUIREMENTS_POST_TO_INTERNAL : { id : 25 }, ACTION_COPY_REQUIREMENTS_POST_TO_BOTH : { id : 26 }, ACTION_SOURCING_IMPORT_APPLICANT : { id : 27 }, ACTION_SOURCING_IMPORT_CONTACT : { id : 28 }, ACTION_SEND_SMS_AND_EMAIL : { id : 29 }, QUICK_SEARCH_APPLICANT : { id : 31 }, QUICK_SEARCH_CLIENT : { id : 32 }, QUICK_SEARCH_CONTACT : { id : 33 }, QUICK_SEARCH_REQUIREMENT : { id : 34 }, QUICK_SEARCH_WORKGROUP : { id : 35 }, QUICK_SEARCH_RECRUITER : { id : 36 }, ACTION_APPLICATION_CAREERBUILDER : { id : 41 }, ACTION_APPLICATION_MONSTER : { id : 42 }, ACTION_APPLICATION_LINKEDIN : { id : 48 }, ACTION_APPLICATION_SOURCEJET : { id : 410 }, ACTION_MASS_REMOVE_APPLICANT_FROM_FOLDER : { id : 49 }, ACTION_MASS_REMOVE_CLIENT_FROM_FOLDER : { id : 50 }, ACTION_MASS_REMOVE_CONTACT_FROM_FOLDER : { id : 51 }, ACTION_MASS_REMOVE_REQUIREMENT_FROM_FOLDER : { id : 52 }, } } function getFieldTypes() { return { TEXT : { id : 1 }, TEXTAREA : { id : 2 }, CHECKBOX : { id : 3 }, SELECT : { id : 4 }, NUMBER : { id : 5 }, CURRENCY : { id : 6 }, DATE : { id : 7 }, SEPARATOR : { id : 8 }, READ_ONLY : { id : 9 }, TIME : { id : 10 }, } } function getEntityTypes() { return { APPLICANT : { id : 1, name : getValue('Applicant') }, CONTACT : { id : 2, name : getValue('Contact') }, OFFICE : { id : 3, name : getValue('Office') }, CLIENT : { id : 4, name : getValue('Client') }, REQUIREMENT : { id : 5, name : getValue('Requirement') }, PLACEMENT : { id : 6, name : getValue('') }, ACTIVITY : { id : 7, name : getValue('Activity') }, COMPANY_INVOICE : { id : 8, name : getValue('') }, COMPANY_GL : { id : 9, name : getValue('') }, COMPANY_BILLING : { id : 10, name : getValue('') }, REFERENCE : { id : 11, name : getValue('Reference Check') }, OPPORTUNITY : { id : 12, name : getValue('') }, COMPANY : { id : 13, name : getValue('Company') }, BASIC_QUALIFICATION : { id : 14, name : getValue('') }, CALENDAR : { id : 15, name : getValue('') }, CORPORATE : { id : 16, name : getValue('Corporate') }, INTERVIEWER : { id : 17, name : getValue('Interviewer') }, COMPANY_PREFERENCE : { id : 18, name : getValue('') }, APPLICANT_EXPERIENCE : { id : 19, name : getValue('Applicant Experience') }, EMPLOYEE : { id : 20, name : getValue('Employee') }, SECURITY_ROLE : { id : 21, name : getValue('SecurityRole') }, fromId : function(id) { var type; switch (id) { case this.APPLICANT.id: type = this.APPLICANT; break; case this.CONTACT.id: type = this.CONTACT; break; case this.COMPANY.id: type = this.COMPANY; break; case this.CLIENT.id: type = this.CLIENT; break; case this.REQUIREMENT.id: type = this.REQUIREMENT; break; case this.EMPLOYEE.id: type = this.EMPLOYEE; break; case this.OFFICE.id: type = this.OFFICE; break; default: break; } return type; } } } function getSearchTypes() { return { APPLICANT : { id : 2, name : getValue('Applicant') }, CLIENT : { id : 3, name : getValue('Client') }, CONTACT : { id : 4, name : getValue('Contact') }, REQUIREMENT : { id : 5, name : getValue('Requirement') }, POWER_SEARCH_REQUEST_APPLICANT : { id : 11, name : getValue('PowerSearchRequestApplicant') }, POWER_SEARCH_REQUEST_CONTACT : { id : 12, name : getValue('PowerSearchRequestContact') }, POWER_SEARCH_REQUEST_OFFICE : { id : 13, name : getValue('PowerSearchRequestOffice') }, POWER_SEARCH_REQUEST_CLIENT : { id : 14, name : getValue('PowerSearchRequestClient') }, POWER_SEARCH_REQUEST_REQUIREMENT : { id : 15, name : getValue('PowerSearchRequestRequirement') }, fromId : function(id) { var type; switch (id) { case this.APPLICANT.id: type = this.APPLICANT; break; case this.CLIENT.id: type = this.CLIENT; break; case this.CONTACT.id: type = this.CONTACT; break; case this.REQUIREMENT.id: type = this.REQUIREMENT; break; case this.POWER_SEARCH_REQUEST_APPLICANT.id: type = this.POWER_SEARCH_REQUEST_APPLICANT; break; case this.POWER_SEARCH_REQUEST_CONTACT.id: type = this.POWER_SEARCH_REQUEST_CONTACT; break; case this.POWER_SEARCH_REQUEST_OFFICE.id: type = this.POWER_SEARCH_REQUEST_OFFICE; break; case this.POWER_SEARCH_REQUEST_CLIENT.id: type = this.POWER_SEARCH_REQUEST_CLIENT; break; case this.POWER_SEARCH_REQUEST_REQUIREMENT.id: type = this.POWER_SEARCH_REQUEST_REQUIREMENT; break; default: break; } return type; } } } function getReqApprovalTypes() { return { NONE : { id : -1, name : getValue('None') }, PENDING : { id : 1, name : getValue('Pending') }, APPROVED : { id : 2, name : getValue('Approved') }, REJECTED : { id : 3, name : getValue('Rejected') }, } } function getScreenTypes() { return { APPLICANT : { id : 1 }, CONTACT : { id : 4 }, OFFICE : { id : 3 }, CLIENT : { id : 2 }, REQUIREMENT : { id : 5 }, } } function getBillingTypes() { return { NONE : { id : -1 }, CC : { id : 1 }, CHARGIFY : { id : 2 }, EMAIL : { id : 4 }, RESELLER_INVOICE : { id : 5 }, } } function getUserTypes() { return { NONE : { id : -1, name : getValue('None') }, EMPLOYEE : { id : 1, name : getValue('Employee') }, APPLICANT : { id : 2, name : getValue('Applicant') }, CONTACT : { id : 3, name : getValue('Contact') }, ADMIN : { id : 4, name : getValue('Admin') }, REFERRER : { id : 5, name : getValue('Referrer') }, SOURCER : { id : 6, name : getValue('Sourcer') }, SALES : { id : 7, name : getValue('Sales') }, VENDOR : { id : 8, name : getValue('Vendor') }, INTERVIEWER : { id : 9, name : getValue('Interviewer') }, EXECUTIVE : { id : 10, name : getValue('Executive') }, fromId : function(id) { var type; switch (id) { case this.EMPLOYEE.id: case this.EXECUTIVE.id: type = this.EMPLOYEE; break; case this.APPLICANT.id: type = this.APPLICANT; break; case this.CONTACT.id: type = this.CONTACT; break; case this.ADMIN.id: type = this.ADMIN; break; case this.REFERRER.id: type = this.REFERRER; break; case this.SOURCER.id: type = this.SOURCER; break; case this.SALES.id: type = this.SALES; break; case this.VENDOR.id: type = this.VENDOR; break; case this.INTERVIEWER.id: type = this.INTERVIEWER; break; default: break; } return type; } } } app.filter('displayPlacementType', function() { return function (id) { if (parseInt(id, 10) === -1) { } if (parseInt(id, 10) === 1) { return ''; } if (parseInt(id, 10) === 2) { return ''; } if (parseInt(id, 10) === 3) { return ''; } if (parseInt(id, 10) === 4) { return ''; } } }); function getPlacementTypes() { return { UNKNOWN : { id : -1, }, CONTRACT : { id : 1, name : '' }, PERMANENT : { id : 2, name : '' }, INTERNAL : { id : 3, name : '' }, CONTRACT_TO_HIRE : { id : 4, name : '' }, } } function getThemeGk(themeGk) { if (!themeGk) { return -1; } return themeGk; } function getValue(p) { if (p === 'true') { return true; } else if (p === 'false') { return false; } else if (isNumeric(p)) { return parseInt(p); } else if (isJson(p)) { return JSON.parse(p) } else { p = p.replace(/([\"\'])/g, '\\' + '$&'); return p.toString(); } } app.constant('BM_PARAMS', { }); app.constant('BM_CONSTANTS', { "brightSync" : { "endpoint" : 'https://brightsync.brightmove.com/' }, "newCompanyDays" : getValue(30), "maxSendoutSize" : 25, "modalTimeout" : 10, "maxReqLocations" : 50, "backgroundRefreshInterval" : 5, "visitsStartDate" : '02/06/2019', "analyticsStartDate" : '03/23/2019', "duplicationSource" : { "brightMove" : 4, "careerBuilder" : 2, "monster" : 1, "linkedIn" : 3 }, "skin" : { "reseller" : getValue(''), "portalUrl" : getValue(''), "salesPhone" : getValue('') }, "types" : { "ENTITY" : getEntityTypes(), "USER" : getUserTypes(), "SCREEN" : getScreenTypes(), "FIELD" : getFieldTypes(), "DROPDOWN" : getDropdownTypes(), "STATUS" : getStatusTypes(), "FILTER" : getFilterTypes(), "PLACEMENT" : getPlacementTypes(), "REQAPPROVALSTATUS" : getReqApprovalTypes(), "SUBMITTAL_TEMPLATE" : getSubmittalTemplateTypes(), "SEARCH" : getSearchTypes(), "BILLING" : getBillingTypes() }, "quickbooks": { "url": { "contact": 'https://app.qbo.intuit.com/app/customerdetail?nameId=', "invoice": 'https://app.qbo.intuit.com/app/invoice?txnId=', "payment": 'https://app.qbo.intuit.com/app/recvpayment?txnId=', } }, "brightReports" : { "url" : 'https://brightreports-prod.brightmove.com' }, "phoneRegex" : /^((\+\d{1,3}(-| |.)?\(?\d\)?(-| |.)?\d{1,3})|(\(?\d{3}\)?))(-| |.)?(\d{3,4})(-| |.)?(\d{4})(( e?x?t?.? ?|,*|;)\d{1,10}){0,1}$/, "events" : { "TITLE_DID_UPDATE": "titleDidUpdate", "ACTIVITY_DID_UPDATE" : 'activityDidUpdate', "ACTIVITY_DID_DELETE" : 'activityDidDelete', "SUBMITTAL_ACTIVITY_DID_UPDATE" : 'submittalActivityDidUpdate', "DATATABLE_SELECT_ALL" : 'dataTableSelectAll', "DATATABLE_DESELECT_ALL" : 'dataTableDeselectAll', "DATATABLE_BROADCAST_DATA" : 'dataTableBroadcastData', "DATATABLE_DID_UPDATE" : 'dataTableDidUpdate', "WORKBENCH_ACCESS_DID_UPDATE" : 'workbenchAccessDidUpdate', "MODAL_DID_CLOSE" : 'modalDidClose', "ENTITY_DID_SAVE" : 'entityDidSave', "REFRESH_ACTIVITIES" : 'refreshActivities' }, "colors" : { "AQUA" : '#00A9D0', "BLACK" : '#000000', "BLUE" : '#164B99', "GREEN" : '#AEC237', "WHITE" : '#FFFFFF', "YELLOW" : '#F3CA2F' }, "PORTAL_V3_EMBED_URL": 'https://bm-static-content.s3.amazonaws.com/portal/embed/prod/embedv3.js', "exportPermission": 'export.power.search', "keys" : { "CALENDAR_START_DATE" : 'calendarStartDate', "CALENDAR_VIEW_TYPE" : 'calendarViewType', "SAVE_CALENDAR_VIEW" : 'saveCalendarView', }, "paymentModifierTypes": { "FLAT_FEE": 1, "PERCENTAGE_FEE": 2 }, "paymentDateTypes": { "START_DATE": 1, "HIRE_DATE": 2 }, "retainerDateTypes": { "APPROVAL_DATE": 1 } }); app.constant('BM_PREFERENCES', { "angularFormats" : { "date" : 'MM/dd/yyyy', "activityDateTime" : 'MM/dd/yyyy hh:mm a', "calendarActivityTime" : 'h:mm', "debugDateTime" : 'MM/dd/yyyy hh:mm:ss a' }, "darkMode" : getValue(false), "emailParserDomain": '', "formats" : { "date" : '', "dateTime" : '', "activityDateTime" : '', "activityDate" : '', "activityTime" : '', "displayDate" : '', "displayDateMonth" : 'MMMM dd, yyyy', "amPm" : '', "planner" : '', "dstOffset" : getValue(''), "rawOffset" : getValue(''), "serverTimezone" : ((getValue('') / 1000 / 60 / 60) * 100).toString(), "serverTimezoneOffset" : '', "timeZoneName" : '', "userTimeZoneRawOffset" : ((getValue('') / 1000 / 60 / 60) * 100).toString(), "timeZoneOffset" : ((getValue('') / 1000 / 60 / 60) * 100).toString(), "dstTimeZoneOffset" : ((getValue('0') / 1000 / 60 / 60) * 100).toString(), "currentTimeZoneOffset" : '' }, "replacements" : { "APPLICANT" : '', "APPLICANTS" : '', "CLIENT" : '', "CLIENTS" : '', "CONTACT" : '', "CONTACTS" : '', "OFFICE" : '', "OFFICES" : '', "PLACEMENT" : '', "PLACEMENTS" : '', "PLACEMENT_PERMANENT" : '', "PLACEMENT_CONTRACT" : '', "PLACEMENT_CONTRACT_TO_HIRE" : '', "PLACEMENT_INTERNAL" : '', "REQUIREMENT" : '', "REQUIREMENTS" : '', "SUBMITTAL" : '', "SUBMITTALS" : '', "VENDOR" : '', "VENDORS" : '', "WORKGROUP" : '', "WORKGROUPS" : '', "DO_NOT_HIRE" : '', "RECRUITER" : 'Recruiter', "CLIENT_CONTRACT" : '', "PRODUCT" : { "VALUE" : '', "PLURAL" : '' } }, "settings" : { "enableSms" : getValue(''), "disableActivityHover" : getValue(''), "showMapQuestLink" : getValue(''), "showGoogleMapsLink" : getValue(''), "tieredSales" : getValue(''), "tabbedApplicant" : getValue(''), "tabbedRequirement" : getValue(''), "tabbedClient" : getValue(''), "tabbedContact" : getValue(''), "tabbedUdfs" : getValue(''), "enableBrightForms" : getValue(''), "trackGdpr" : getValue(''), "showLastActivity" : getValue(''), "enableRecruitingHelp" : getValue(''), "recruitingHelpText" : getValue(""), "recruitingHelpConfirmation" : getValue(""), "requireSubmittalActivityComment" : getValue(''), "maxSendoutRecipients" : '25', "showConfetti" : getValue(''), "enableRpoFromAddress" : getValue(''), "displayAnalyticsDetails" : getValue('false'), "employeeAnswerOfccpQuestions" : getValue('') }, "placementProductsEnabled": getValue('') }); app.constant('BM_USER', { "guid" : '', "displayName" : '', "userGk" : getValue(''), "companyGk" : getValue(''), "myCompanyGk" : getValue(''), "companyGuid" : '', "localeName" : getValue(''), "timeZone" : getValue(''), "localeId" : getValue(''), "remoteAddr" : '10.10.1.252', "rpoAccess" : getValue(''), "parentCompanyGk" : getValue(''), "ssoEnabled" : getValue(''), "managingOtherCompany" : getValue(''), "adminUser" : false, "themeGk" : getThemeGk(), "type" : { "id" : getValue('') }, "licensedForms" : getValue(0) }); app.constant('PORTAL', { "overrideKoQuestion": getValue(''), "createDeclineSubmit": getValue(''), "createApplicantImmediately": getValue('') }); app.constant('PORTAL_USER', { "guid" : '', "sourceId" : getValue(''), "userGk" : '', "companyGk" : getValue(''), "activityDateTime" : getValue(''), "activityDate" : getValue(''), "activityTime" : getValue(''), "activityAmPm" : getValue(''), "type" : { "id" : getValue('') } }); function setStorageItems() { localStorage.setItem('DARK_MODE', getValue(false)); } setStorageItems(); })();