TimeTrex/interface/html5/dist/portal-hr-my_jobapplication-MyJobApplicationViewController.bundle.js

1 line
13 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["portal-hr-my_jobapplication-MyJobApplicationViewController"],{4813:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MyJobApplicationViewController\": () => (/* binding */ MyJobApplicationViewController)\n/* harmony export */ });\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7526);\n/* harmony import */ var _views_BaseViewController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(121);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\nclass MyJobApplicationViewController extends _views_BaseViewController__WEBPACK_IMPORTED_MODULE_1__.BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#my_job_application_view',\n\t\t\tevents: {\n\t\t\t\t'click #available_jobs': 'availableJobsClick',\n\t\t\t\t// 'click #applied_jobs': 'appliedJobsClick',\n\t\t\t\t'click #applyBtn': 'onApplyJobClick'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\n\t\tthis.viewId = 'MyJobApplication';\n\t\tthis.api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_0__/* .TTAPI.APIJobApplicantPortal */ .y.APIJobApplicantPortal;\n\t\tthis.$( '.search-result .content' ).empty();\n\t\tthis.search();\n\t}\n\n\tavailableJobsClick() {\n\t\twindow.location = Global.getBaseURL() + '#!m=PortalJobVacancy&company_id=' + LocalCacheData.getAllURLArgs().company_id;\n\t\tLocalCacheData.setAllURLArgs( {} );\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = {};\n\t\tcolumn_filter.id = true;\n\t\tcolumn_filter.job_vacancy = true;\n\t\tcolumn_filter.job_vacancy_id = true;\n\t\tcolumn_filter.interview_date = true;\n\t\tcolumn_filter.created_date = true;\n\n\t\treturn column_filter;\n\t}\n\n\tsearch( page_action, page_number, callBack ) {\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\t// this.addSearchResultPanel();\n\t\tthis.vacancy_list_panel = this.$( '.search-result .content' );\n\t\tthis.more_btn = this.$( '.search-result .more' );\n\t\tthis.more_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t$this.loadMore();\n\t\t} );\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_sort = {};\n\t\tfilter.filter_columns = this.getFilterColumnsFromDisplayColumns();\n\t\tfilter.filter_items_per_page = 0; // Default to 0 to load user preference defined\n\t\tif ( this.pager_data ) {\n\t\t\tif ( page_action === 'next' ) {\n\t\t\t\tfilter.filter_page = this.pager_data.next_page;\n\t\t\t} else {\n\t\t\t\tfilter.filter_page = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tfilter.filter_page = 1;\n\t\t}\n\t\tthis.api['getJobApplication']( filter, false, { // paging or none\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t// if ( !$this.pager_data ) {\n\t\t\t\t// \t$this.vacancy_list_panel.empty();\n\t\t\t\t// }\n\t\t\t\tif ( !Global.isArray( result_data ) ) {\n\t\t\t\t\tvar no_result_span = $( '<span class=\"vacancy-list-no-result\">' + $.i18n._( 'No Results Found' ) + '</span>' );\n\t\t\t\t\t$this.vacancy_list_panel.append( no_result_span );\n\t\t\t\t\t$this.vacancy_list_panel.css( 'text-align', 'center' );\n\t\t\t\t\t$this.more_btn.hide();\n\t\t\t\t} else {\n\t\t\t\t\tfor ( var i = 0; i < result_data.length; i++ ) {\n\t\t\t\t\t\tvar row_data = result_data[i];\n\t\t\t\t\t\tvar row_template = Global.loadWidget( 'views/portal/hr/my_jobapplication/MyJobApplicationRow.html' );\n\t\t\t\t\t\tvar args = {\n\t\t\t\t\t\t\tjob_vacancy: $.i18n._( row_data['job_vacancy'] ),\n\t\t\t\t\t\t\tcreated_date: $.i18n._( row_data['created_date'] )\n\t\t\t\t\t\t};\n\t\t\t\t\t\trow_template = $( _.template( row_template )( args ) );\n\t\t\t\t\t\tvar url = Global.getBaseURL() + '#!m=PortalJobVacancyDetail&id=' + row_data['job_vacancy_id'] + '&company_id=' + LocalCa