@fluxhub/fluxhub-lib 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/fluxhub-fluxhub-lib.umd.js +12 -12
- package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
- package/docs/classes/FHUtility.html +3176 -0
- package/docs/classes/dati_aggiuntivi.html +6654 -0
- package/docs/classes/dt.html +1091 -0
- package/docs/classes/wkfapp.html +3007 -0
- package/docs/components/ApprovaGridComponent.html +1433 -0
- package/docs/components/ComboBoxEditor.html +1704 -0
- package/docs/components/CurrencyComponent.html +1148 -0
- package/docs/components/DateComponent.html +1611 -0
- package/docs/components/DtPick.html +1793 -0
- package/docs/components/FHAutoCompleteComponent.html +2601 -0
- package/docs/components/FHComboboxComponent.html +2390 -0
- package/docs/components/FHConfirmComponent.html +1354 -0
- package/docs/components/FHCurrencyFieldComponent.html +2021 -0
- package/docs/components/FHDatePickerComponent.html +2033 -0
- package/docs/components/FHGridComponent.html +5734 -0
- package/docs/components/FHListComponent.html +2300 -0
- package/docs/components/FHListPick.html +1422 -0
- package/docs/components/FHLogPanelComponent.html +978 -0
- package/docs/components/FHMdReader.html +1130 -0
- package/docs/components/FHNumericFieldComponent.html +2025 -0
- package/docs/components/FHPickListComponent.html +2321 -0
- package/docs/components/FHRichText.html +1689 -0
- package/docs/components/FHTimePickerComponent.html +2395 -0
- package/docs/components/FHUploadComponent.html +2161 -0
- package/docs/components/FHUploadPanelComponent.html +1844 -0
- package/docs/components/FHUserFieldComponent.html +1832 -0
- package/docs/components/FHUserPickerComponent.html +2065 -0
- package/docs/components/FHWinComboSelect.html +1352 -0
- package/docs/components/FSInput.html +1097 -0
- package/docs/components/FSResult.html +1087 -0
- package/docs/components/NumericEditorComponent.html +1396 -0
- package/docs/components/QGParam.html +1262 -0
- package/docs/components/QGResult.html +1116 -0
- package/docs/components/QParam.html +1131 -0
- package/docs/components/QResult.html +1087 -0
- package/docs/components/TextAreaEditor.html +1584 -0
- package/docs/components/WinAskNumberComponent.html +1462 -0
- package/docs/components/WinAskTextBigComponent.html +1383 -0
- package/docs/components/WinAskTextComponent.html +1424 -0
- package/docs/components/WinOutputComponent.html +1388 -0
- package/docs/components/WinWait.html +1338 -0
- package/docs/components/win_assegna.html +1473 -0
- package/docs/components/win_commenti.html +2221 -0
- package/docs/components/win_commento_sel_notif.html +1361 -0
- package/docs/components/win_conferma.html +1479 -0
- package/docs/components/win_grid_help.html +1213 -0
- package/docs/components/win_info_doc.html +1458 -0
- package/docs/components/win_log.html +2232 -0
- package/docs/components/win_mappa.html +1670 -0
- package/docs/components/win_recupera_doc.html +1470 -0
- package/docs/components/win_riassegna_select_level.html +1519 -0
- package/docs/components/win_riassegna_select_user.html +1477 -0
- package/docs/components/win_salva_annulla.html +1224 -0
- package/docs/components/win_select_canale.html +1341 -0
- package/docs/components/win_select_level.html +1504 -0
- package/docs/components/win_time_slider.html +1374 -0
- package/docs/components/win_uploads.html +2132 -0
- package/docs/coverage.html +2177 -0
- package/docs/dependencies.html +989 -0
- package/docs/directives/DecimalMask.html +1102 -0
- package/docs/directives/FHCurrencyFormatterDirective.html +1110 -0
- package/docs/fonts/FontAwesome.otf +0 -0
- package/docs/fonts/fontawesome-webfont.eot +0 -0
- package/docs/fonts/fontawesome-webfont.svg +685 -0
- package/docs/fonts/fontawesome-webfont.ttf +0 -0
- package/docs/fonts/fontawesome-webfont.woff +0 -0
- package/docs/fonts/fontawesome-webfont.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-300.eot +0 -0
- package/docs/fonts/roboto-v15-latin-300.svg +314 -0
- package/docs/fonts/roboto-v15-latin-300.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-300.woff +0 -0
- package/docs/fonts/roboto-v15-latin-300.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-700.eot +0 -0
- package/docs/fonts/roboto-v15-latin-700.svg +310 -0
- package/docs/fonts/roboto-v15-latin-700.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-700.woff +0 -0
- package/docs/fonts/roboto-v15-latin-700.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-regular.eot +0 -0
- package/docs/fonts/roboto-v15-latin-regular.svg +308 -0
- package/docs/fonts/roboto-v15-latin-regular.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-regular.woff +0 -0
- package/docs/fonts/roboto-v15-latin-regular.woff2 +0 -0
- package/docs/graph/dependencies.svg +1294 -0
- package/docs/images/compodoc-vectorise-inverted.svg +201 -0
- package/docs/images/compodoc-vectorise.svg +201 -0
- package/docs/images/coverage-badge.svg +9 -0
- package/docs/images/favicon.ico +0 -0
- package/docs/index.html +870 -0
- package/docs/injectables/AppMakerService.html +1187 -0
- package/docs/injectables/AppService.html +1981 -0
- package/docs/injectables/AuthenticationService.html +1659 -0
- package/docs/injectables/FHGuard.html +1382 -0
- package/docs/injectables/FileService.html +1154 -0
- package/docs/injectables/GridService.html +1187 -0
- package/docs/injectables/OdbcService.html +1187 -0
- package/docs/injectables/QueryService.html +1279 -0
- package/docs/injectables/UtilityService.html +3170 -0
- package/docs/injectables/WkfService.html +1187 -0
- package/docs/js/compodoc.js +14 -0
- package/docs/js/libs/EventDispatcher.js +5 -0
- package/docs/js/libs/bootstrap-native.js +2 -0
- package/docs/js/libs/d3.v3.min.js +2 -0
- package/docs/js/libs/deep-iterator.js +2 -0
- package/docs/js/libs/es6-shim.min.js +12 -0
- package/docs/js/libs/htmlparser.js +23 -0
- package/docs/js/libs/innersvg.js +9 -0
- package/docs/js/libs/prism.js +14 -0
- package/docs/js/libs/promise.min.js +6 -0
- package/docs/js/libs/svg-pan-zoom.min.js +3 -0
- package/docs/js/libs/tablesort.min.js +5 -0
- package/docs/js/libs/tablesort.number.min.js +5 -0
- package/docs/js/libs/vis.min.js +46 -0
- package/docs/js/libs/zepto.min.js +2 -0
- package/docs/js/menu.js +222 -0
- package/docs/js/routes.js +280 -0
- package/docs/js/search/lunr.min.js +1 -0
- package/docs/js/search/search-lunr.js +67 -0
- package/docs/js/search/search.js +271 -0
- package/docs/js/search/search_index.js +4 -0
- package/docs/js/sourceCode.js +58 -0
- package/docs/js/svg-pan-zoom.controls.js +50 -0
- package/docs/js/tabs.js +21 -0
- package/docs/js/tree.js +147 -0
- package/docs/miscellaneous/typealiases.html +903 -0
- package/docs/miscellaneous/variables.html +1226 -0
- package/docs/modules/FluxhubLibModule/dependencies.svg +1294 -0
- package/docs/modules/FluxhubLibModule.html +2614 -0
- package/docs/modules/MaterialModule.html +888 -0
- package/docs/modules.html +894 -0
- package/docs/overview.html +2219 -0
- package/docs/pipes/EscapeHtmlPipe.html +963 -0
- package/docs/pipes/FHCurrencyPipe.html +1067 -0
- package/docs/pipes/ReplaceLineBreaks.html +967 -0
- package/docs/styles/bootstrap-card.css +219 -0
- package/docs/styles/bootstrap.min.css +6 -0
- package/docs/styles/compodoc.css +896 -0
- package/docs/styles/font-awesome.min.css +4 -0
- package/docs/styles/laravel.css +69 -0
- package/docs/styles/material.css +109 -0
- package/docs/styles/original.css +47 -0
- package/docs/styles/postmark.css +210 -0
- package/docs/styles/prism.css +268 -0
- package/docs/styles/readthedocs.css +98 -0
- package/docs/styles/reset.css +48 -0
- package/docs/styles/stripe.css +65 -0
- package/docs/styles/style.css +7 -0
- package/docs/styles/tablesort.css +33 -0
- package/docs/styles/vagrant.css +96 -0
- package/esm2015/lib/controls/fhuploadpanel.js +62 -48
- package/esm2015/lib/fluxhub-lib.module.js +1 -1
- package/esm2015/lib/services/app_maker.service.js +1 -2
- package/esm2015/lib/services/dofile.service.js +1 -2
- package/esm2015/lib/services/doquery.service.js +2 -2
- package/esm5/lib/controls/fhuploadpanel.js +11 -11
- package/esm5/lib/fluxhub-lib.module.js +1 -1
- package/esm5/lib/services/app_maker.service.js +1 -2
- package/esm5/lib/services/dofile.service.js +1 -2
- package/esm5/lib/services/doquery.service.js +2 -2
- package/fesm2015/fluxhub-fluxhub-lib.js +65 -51
- package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
- package/fesm5/fluxhub-fluxhub-lib.js +12 -12
- package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
- package/fluxhub-fluxhub-lib.metadata.json +1 -1
- package/lib/controls/fhuploadpanel.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs/Observable"),require("rxjs/Rx"),require("@angular/http"),require("rxjs/operators"),require("rxjs"),require("@angular/cdk/table"),require("@angular/material"),require("@angular/platform-browser"),require("ngx-toastr"),require("@angular/forms"),require("@angular/common/http"),require("ng2-file-upload"),require("ng2-slim-loading-bar"),require("ag-grid-enterprise"),require("jquery"),require("@angular/router"),require("@angular/flex-layout"),require("ngx-markdown"),require("ng2-ckeditor"),require("@angular/common"),require("ag-grid-angular"),require("mydatepicker"),require("@agm/core")):"function"==typeof define&&define.amd?define("@fluxhub/fluxhub-lib",["exports","@angular/core","rxjs/Observable","rxjs/Rx","@angular/http","rxjs/operators","rxjs","@angular/cdk/table","@angular/material","@angular/platform-browser","ngx-toastr","@angular/forms","@angular/common/http","ng2-file-upload","ng2-slim-loading-bar","ag-grid-enterprise","jquery","@angular/router","@angular/flex-layout","ngx-markdown","ng2-ckeditor","@angular/common","ag-grid-angular","mydatepicker","@agm/core"],e):e((t.fluxhub=t.fluxhub||{},t.fluxhub["fluxhub-lib"]={}),t.ng.core,t.rxjs.Observable,t.rxjs.Rx,t.ng.http,t.rxjs.operators,t.rxjs,t.ng.cdk.table,t.ng.material,t.ng.platformBrowser,null,t.ng.forms,t.ng.common.http,null,null,null,null,t.ng.router,t.ng["flex-layout"],null,null,t.ng.common,null,null,null)}(this,function(t,l,i,e,a,s,r,n,o,p,c,u,h,d,_,g,m,f,v,y,b,I,S,E,O){"use strict";"default"in m&&m["default"];var R=function(){function t(){this.API_ENDPOINT="http://localhost:9090/api/",this.PORTAL_TITLE="FLUXHUB INTRANET PORTAL",this.COMPANY_KEY="PROLOGIKA_",this.COMPANY_SITE_ROOT="http://localhost:4200/",this.SQL_SERVER_LANG="uk",this.LOCAL_PATH="",this.LOGIN_EXT=0,this.LDAP_AUTH=0,this.CHANGE_PASSWORD=1,this.COLOR_SEARCH="#FFFFFF",this.LOGOUT_URL_EXT="",this.GRID_ENDPOINT="dogrid",this.UPLOAD_ENDPOINT="doupload",this.LOGIN_ENDPOINT="login",this.APPMAKER_ENDPOINT="do_app_maker",this.FILE_ENDPOINT="dofile",this.ODBC_ENDPOINT="doquery_odbc",this.QUERY_ENDPOINT="doquery",this.WKF_ENDPOINT="dowkf",this.PASSRECOVERY_ENDPOINT="passrecovery",this.state={appName:"FLUXHUB V2",darkMode:!1,defaultLang:"en",topnavTitle:"Fluxhub",sidenavOpen:!1,sidenavMode:"side",sidenavCollapse:!0,pageFullscreen:!1,pageFooter:!1,initial:!1,wkf_obj:null,wkf_doc_info:null,grid_obj:null,appo_dialog:null,m_notif:null,style_search_home:this.COLOR_SEARCH,mobile:!1,body_height:"0px",body_height1:"0px",body_height2:"0px"}}return t.prototype.cloneState=function(){return JSON.parse(JSON.stringify(this.state))},t.prototype.reloadState=function(t){this.state=t},t.prototype.getState=function(t){var e=this.state;return e.hasOwnProperty(t)?e[t]:e},t.prototype.setState=function(t,e){return this.state[t]=e},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=l.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),w=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),C=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT,console.log("FileService url: "+this.url);var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),A=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type",'"application/x-www-form-urlencoded; charset=utf-8"')}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,console.log("AppMakerService url: "+this.url);var e=JSON.stringify(t);return this.http.post(this.url,e).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),r.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).pipe(s.map(function(t){return new Blob([t],{type:"application/octect"})}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),N=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),D=function(){function t(){this.values=new Array,this.types=new Array,this.names=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),k=function(){function t(){}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),T=function(){function t(){this.command="",this.p1="",this.p2=""}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),M=function(){function t(){}return t.decorators=[{type:l.NgModule,args:[{exports:[n.CdkTableModule,o.MatAutocompleteModule,o.MatDialogModule,o.MatButtonModule,o.MatButtonToggleModule,o.MatCardModule,o.MatCheckboxModule,o.MatChipsModule,o.MatDatepickerModule,o.MatDialogModule,o.MatExpansionModule,o.MatFormFieldModule,o.MatGridListModule,o.MatIconModule,o.MatInputModule,o.MatListModule,o.MatMenuModule,o.MatProgressBarModule,o.MatProgressSpinnerModule,o.MatRadioModule,o.MatSelectModule,o.MatSlideToggleModule,o.MatSliderModule,o.MatSidenavModule,o.MatSnackBarModule,o.MatStepperModule,o.MatTabsModule,o.MatToolbarModule,o.MatTooltipModule,o.MatPaginatorModule,o.MatSortModule,o.MatTableModule,o.MatNativeDateModule]}]}],t}();function x(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(i=s["return"])&&i.call(s)}finally{if(o)throw o.error}}return r}var P=function(){function t(t){this.app_s=t}return t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(undefined);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),0<(t||"").toString().indexOf(",")&&(t=(t||"").toString().split(".").join("").split(",").join("."));var s=x((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=0<e?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e){if(10!=t.length)return null;var i=t.split("-");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]))}if(2==e&&19<=t.length){i=(o=(t=t.substring(0,19)).split("T"))[0].split("-");var n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}if(3==e&&16<=t.length){var o;i=(o=(t=t.substring(0,16)).split(" "))[0].split("/"),n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),0)}return null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.DateAdd=function(t,e,i){var n,o=i.valueOf();switch(t){case"ms":n=new Date(o+1*e);break;case"s":n=new Date(o+1e3*e);break;case"mi":n=new Date(o+6e4*e);break;case"h":n=new Date(o+36e5*e);break;case"d":n=new Date(o+864e5*e);break;case"y":n=new Date(o+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()," ",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i,"T",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,r,a,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",r=void 0===n?",":n,(t<0?"-":"")+((l=3<(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)?l%3:0)?a.substr(0,l)+r:"")+a.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+r)+(o?s+Math.abs(t-a).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles")&&(!(!e||null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin"))||-1<localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles").toUpperCase().indexOf(t.toLocaleUpperCase()))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(R))},token:t,providedIn:"root"}),t}(),L=function(){function t(t){this.uti_s=t,this.cancelBeforeStart=!1}return t.prototype.agInit=function(t){var e=this;this.params=t,this.value=this.params.value,0<="1234567890,".indexOf(t.charPress)?(this.value=t.charPress,setTimeout(function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,1,String(e.value).length)},100)):setTimeout(function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,0,String(e.value).length)},100),this.cancelBeforeStart=t.charPress&&"1234567890,".indexOf(t.charPress)<0},t.prototype.getValue=function(){return""==String(this.value)?0:(this.value,null!=this.value?parseFloat(this.value.split(".").join("").split(",").join(".")):0)},t.prototype.isCancelBeforeStart=function(){return this.cancelBeforeStart},t.prototype.isCancelAfterEnd=function(){return 1e6<parseFloat(this.value.split(".").join("").split(",").join("."))},t.prototype.onKeyDown=function(t){console.log("numeric editore: onKeyDown"),this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){this.input.element.nativeElement.focus()},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(t=t||window.event).which?t.keyCode:t.which},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.isKeyPressedNumeric=function(t){var e=this.getCharCodeFromEvent(t);if(console.log(e),8==e)return!0;if(188==e)return!0;if(96<=e&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t.decorators=[{type:l.Component,args:[{selector:"numeric-cell",template:'<input #input (keydown)="onKeyDown($event)" [(ngModel)]="value" style="fontSize:40;height:30px;">'}]}],t.ctorParameters=function(){return[{type:P}]},t.propDecorators={input:[{type:l.ViewChild,args:["input",{read:l.ViewContainerRef}]}]},t}(),F=function(){function t(t){this.uti_s=t,this.label=""}return t.prototype.setDt=function(){console.log(this.appdt.getValue()),this.date_zz=this.appdt.getValue(),this.params.api.stopEditing()},t.prototype.ngAfterViewInit=function(){this.appdt.setFocus()},t.prototype.agInit=function(t){return this.params=t,console.log("agInit"),console.log(this.params),null==t.value?(this.date=null,void(this.date_zz=null)):1970==new Date(t.value).getFullYear()?(this.date=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.date=null,void(this.date_zz=null)):(this.date=new Date(t.value),this.appdt.setValue(this.date),void(this.date_zz=new Date(t.value)))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz.getFullYear().toString()+"-"+this.uti_s.format2cifre(this.date_zz.getMonth()+1)+"-"+this.uti_s.format2cifre(this.date_zz.getDate())+"T00:00:00"},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container fxLayout="row" class="mood" tabindex="0" (keydown)="onKeyDown($event)">\n\n <DtPicker [(ngModel)]="date" #appdt\n [show_buttons]="false" ngDefaultControl\n\n >\n </DtPicker>\n <button mat-raised-button (click)="setDt()">CONFERMA</button>\n\n </div>\n\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n .default {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n .selected {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],t.ctorParameters=function(){return[{type:P}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),j=function(){function t(t){this.sanitizer=t}return t.prototype.transform=function(t){return t},t.decorators=[{type:l.Pipe,args:[{name:"keepHtml",pure:!1}]}],t.ctorParameters=function(){return[{type:p.DomSanitizer}]},t}(),z=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.uti_s=n,this.res="",this.h=0,this.m=0}return t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.ok=function(){5==this.res.length?this.dialogRef.close(this.res):this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.ngOnInit=function(){if(null!=this.m_appService.getState().appo_dialog&&null!=this.m_appService.getState().appo_dialog.val){var t=this.m_appService.getState().appo_dialog.val.split(":");return this.h=parseInt(t[0]),this.m=parseInt(t[1]),void(this.res=this.m_appService.getState().appo_dialog.val)}},t.decorators=[{type:l.Component,args:[{selector:"fhtimeslider",template:'\n\n <h2 mat-dialog-title style="min-width:300px">Seleziona Orario -> {{res}}</h2>\n\n <mat-dialog-content><br><br>\n <table><tr><td>Ore:</td><td>\n <mat-slider\n [max]="23" (change)="change()"\n [min]="0"\n [step]="1"\n thumbLabel\n [(ngModel)]="h">\n </mat-slider>\n</td></tr><tr><td>Minuti:</td><td>\n <mat-slider\n [max]="45"\n [min]="0" (change)="change()"\n [step]="15"\n thumbLabel\n [(ngModel)]="m">\n </mat-slider>\n</td></tr></table>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n <button mat-raised-button (click)="ok()">OK</button>\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R},{type:P}]},t}(),U=function(){function t(t){this.model=t}return t.prototype.onInputChange=function(t,e){for(var i,n=t.toString().split(","),o=0;o<n.length;++o)n[o]=n[o].replace(/\D/g,"");if(0===n.length)i="";else{if(null!==n[0].match(/[0-9]{3}/gim)&&3<n[0].length){var s=Array.from(Array.from(n[0]).reverse().join("").match(/[0-9]{3}/gim).join()).reverse().join(""),r=n[0].replace(s.replace(/\D/g,""),"");i=(0<r.length?r+".":"")+s}else i=n[0];1<n.length&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t.decorators=[{type:l.Directive,args:[{selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}]}],t.ctorParameters=function(){return[{type:u.NgControl}]},t}(),Y=function(){function t(t,e,i,n){this.http=t,this.toastr=e,this.app_s=i,this.uti_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.init_header()}return t.prototype.init_header=function(){null==this.headers&&(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")?(this.headers=new h.HttpHeaders,this.headers=this.headers.append("Content-Type","application/json"),this.headers=this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))):console.log("token non online"))},t.prototype.doQuery=function(t,i){var n=this;if(void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,console.log("QueryService url: "+this.url),null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var e=0;e<t.types.length;e++)null==t.values[e]?t.values[e]="dbnull":("boolean"==t.types[e]&&(t.values[e]?t.values[e]="1":t.values[e]="0"),"int"==t.types[e]&&(t.values[e]=""+t.values[e]),"string"==t.types[e]&&(t.values[e]=""+t.values[e]),"date"==t.types[e]&&(t.values[e]=this.uti_s.sql_date(t.values[e])),"datetime"==t.types[e]&&(t.values[e]=this.uti_s.sql_date_time(t.values[e])),"decimal"==t.types[e]&&(t.values[e]=""+t.values[e]),"string"==t.types[e]&&null==t.values[e]&&(t.values[e]="dbnull"));var o=JSON.stringify(t);return this.http.post(this.url,o,{headers:this.headers}).pipe(s.map(function(t){var e;if(t?"KO"===t.result_msg&&(e=new Error(t.msg)):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new N}),s.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),r.throwError(t)}))},t.prototype.downloadfile=function(t){var e=new h.HttpHeaders;return e=e.append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h.HttpClient},{type:c.ToastrService},{type:R},{type:P}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(h.HttpClient),l.inject(c.ToastrService),l.inject(R),l.inject(P))},token:t,providedIn:"root"}),t}(),K=function(){function t(t,e,i,n,o){this._dataService=t,this.dialog=e,this.m_appService=i,this.toastr=n,this.uti_s=o,this.maxore=23,this.label="",this.enabled=!0,this.show_picker=!1,this.selchange=new l.EventEmitter,this.h=0,this.m=0,this.res=""}return t.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},t.prototype.doh=function(){0<this.h&&this.h--,this.sc()},t.prototype.upm=function(){this.m<60&&this.m++,this.sc()},t.prototype.dom=function(){0<this.m&&this.m--,this.sc()},t.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},t.prototype.onMi=function(){59<this.m&&(this.m=59),this.sc()},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(t=t||window.event).which?t.keyCode:t.which},t.prototype.isKeyPressedNumeric=function(t){return console.log(t.key),-1!=="0123456789".indexOf(t.key)||"ArrowRight"==t.key||"ArrowLeft"==t.key||"ArrowDown"==t.key||"ArrowUp"==t.key||"Backspace"==t.key},t.prototype.resetValue=function(){this.h=0,this.m=0},t.prototype.annulla=function(){this.show_picker=!1},t.prototype.ok=function(){0!=this.h||0!=this.m?this.sc():this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.setByDescri=function(t){null==t&&(t="00:00"),""==t&&(t="00:00"),-1==t.indexOf(":")&&(t="00:00");var e=t.split(":");this.h=parseInt(e[0]),this.m=parseInt(e[1])},t.prototype.isValidVal=function(){return!0},t.prototype.setByValue=function(t){this.setByDescri(t)},t.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getHours=function(){return this.h},t.prototype.getMinutes=function(){return this.m},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){this.selchange.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHTimePicker",template:'\n<div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b> \n<div fxLayout="column" fxLayoutAlign="center center">\n<div *ngIf="enabled" class="yourClass">\n<mat-icon (click)="uph()">keyboard_arrow_up</mat-icon></div>\n\n<input style="width:40px;text-align:center;" (keydown)="onKeyDown($event)" (focusout)="onFu()" [disabled]="!enabled" [(ngModel)]="h" >\n<div class="yourClass" *ngIf="enabled">\n<mat-icon class="yourClass" (click)="doh()">keyboard_arrow_down</mat-icon></div>\n\n\n</div>\n <b style="font-size:28px">:</b> \n<div fxLayout="column" fxLayoutAlign="center center">\n<div class="yourClass" *ngIf="enabled">\n<mat-icon class="yourClass" (click)="upm()">keyboard_arrow_up</mat-icon></div>\n\n\n<input style="width:40px;text-align:center;" (keydown)="onKeyDown1($event)" (focusout)="onMi()" [disabled]="!enabled" [(ngModel)]="m" >\n<div class="yourClass" *ngIf="enabled">\n<mat-icon class="yourClass" (click)="dom()">keyboard_arrow_down</mat-icon></div>\n\n\n</div>\n\n',styles:["\n.hhh {\n height: 63px;\n width:100px;\n background-color: rgba(255,0,0,.1);\n}\n.yourClass { cursor: pointer; }\n"]}]}],t.ctorParameters=function(){return[{type:Y},{type:o.MatDialog},{type:R},{type:c.ToastrService},{type:P}]},t.propDecorators={maxore:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],selchange:[{type:l.Output}]},t}(),V=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t.decorators=[{type:l.Component,args:[{selector:"currency-cell",template:"{{params.value | currency:'EUR'}}"}]}],t}(),q=function(){function t(t,e){this.dialogRef=t,this.app_s=e,this.title="",this.msg="",this.title=localStorage.getItem(this.app_s.COMPANY_KEY+"title_dialog"),this.msg=localStorage.getItem(this.app_s.COMPANY_KEY+"msg_dialog")}return t.prototype.setTitle=function(t){this.title=t},t.prototype.setMsg=function(t){this.msg=t},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{styles:["\n "],template:'\n <h1 mat-dialog-title>{{title}}</h1>\n <div mat-dialog-content>{{msg}}</div>\n <div mat-dialog-actions>\n <button mat-button (click)="dialogRef.close(true)" color="primary">CONFERMA</button>\n <button mat-button (click)="dialogRef.close(false)" color="warn">ANNULLA</button>\n </div>\n '}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R}]},t}(),B=function(){function t(t,e,i,n,o){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.enabled=!0,this.label="",this.sovrascrivi_path="",this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1}return t.prototype.download_all=function(t){null!=t.APP&&(t.App=t.APP),console.log(this.sovrascrivi_path),""==this.sovrascrivi_path?window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename):window.open(this.sovrascrivi_path+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename)},t.prototype["delete"]=function(i){var n=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(q).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="DELETE_ALLEGATO",e.types=["int"],e.values=[i.id],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))},function(t){})}})},t.prototype.ngOnInit=function(){this.upc.single=!1,this.b_mobile=this._appservice.getState().pageFullscreen,this.upc.init(this.App,this.K,"Descrizione Allegato"),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ngOnInit()},t.prototype.ref_allegato=function(){var e=this;if(null!=this.App&&""!=this.App){var t=new D;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.arr_g=t.result_data)},function(t){})}},t.decorators=[{type:l.Component,args:[{selector:"FHUploadPanel",template:'\n <mat-card><mat-card-header>\n<mat-card-title *ngIf="label!=\'\'">\n <h3>{{label}}</h3>\n</mat-card-title></mat-card-header>\n <mat-card-content>\n <div [hidden]="!enabled">\n <FHUpload [single]="b_False" (change)="ref_allegato()" #upc ></FHUpload>\n <br></div>\n <section class="bs">\n <table border="1" width="98%">\n <thead>\n <tr style="font-size:16px;font-weight:bold;color:white;background-color:#015488">\n <th></th>\n <th *ngIf="!b_mobile">Nome</th>\n <th *ngIf="!b_mobile">Dim.</th>\n <th *ngIf="!b_mobile">Descrizione</th>\n <th *ngIf="!b_mobile">Data</th>\n\n <th n *ngIf="enabled" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of arr_g">\n <td *ngIf="!b_mobile"> <button (click)="download_all(app)" mat-raised-button >DOWNLOAD</button></td>\n <td *ngIf="b_mobile">{{app.Filename}}<br><br> <button (click)="download_all(app)" mat-raised-button >DOWNLOAD</button> </td>\n <td *ngIf="!b_mobile">{{app.Filename}}</td>\n <td *ngIf="!b_mobile">{{app.Filesize}}</td>\n <td *ngIf="!b_mobile">{{app.descrizione}}</td>\n <td *ngIf="!b_mobile">{{app.dt_ins | date: \'dd/MM/yyyy hh:mm:ss\'}}</td>\n\n <td><a mat-icon-button *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n </tr>\n </table>\n </section>\n\n </mat-card-content>\n </mat-card>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:R},{type:Y},{type:c.ToastrService},{type:o.MatDialog},{type:R}]},t.propDecorators={enabled:[{type:l.Input}],label:[{type:l.Input}],sovrascrivi_path:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}]},t}(),H=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.progress_p=0,console.log("constructor()")}return t.prototype.update_progess=function(t){this.progress_p=t,console.log(this.progress_p),100==t&&this.dialogRef.close()},t.prototype.ngOnInit=function(){console.log("ngOnInit()")},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\n {{label|uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <mat-progress-bar style="height:50px" color="accent" mode="determinate" value="{{progress_p}}"></mat-progress-bar>\n\n\n </mat-dialog-content>\n\n\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),G=function(){function t(t,e,i,n){var o=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=n,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 500MB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.change=new l.EventEmitter,this.upload_ended=new l.EventEmitter,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.progress_p=0,this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.uploader=new d.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:524288e3}),this.username=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(o.descrizione="",o.toastr.info("INFO",o.allegato_inserito,{timeOut:1e3,progressBar:!0}),o.ref_allegato(),o.change.emit())}}return t.prototype.ngOnInit=function(){var o=this,t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],console.log(t),this.uploader.setOptions(t),this.uploader.onCompleteAll=function(){o.loading=!1,o.upload_ended.emit()},this.uploader.onErrorItem=function(t,e,i,n){o.toastr.error(e)},this.uploader.onAfterAddingFile=function(){o.ch()},this.uploader.onProgressItem=function(t,e){o.loading=!0,null!=o.dialogRef&&null!=o.dialogRef.componentInstance&&o.dialogRef.componentInstance.update_progess(e)},this.uploader.onWhenAddingFileFailed=function(t,e,i){switch(e.name){case"fileSize":var n=Math.round(t.size/1024/1024);o.toastr.error(o.limit_string.split("<size>").join(""+n));break;default:o.toastr.error("Errore: "+e.name)}}},t.prototype.download_all=function(){window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(){var i=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this.inserire_descrizione):(this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",i.tipo),e.append("local_path",i.app_s.LOCAL_PATH),""!=i.programma_da_eseguire&&e.append("p1",i.programma_da_eseguire)},this.dialogRef=this.dialog.open(H,{disableClose:!0}),this.dialogRef.componentInstance.label=this.label_attendere,this.dialogRef.afterClosed().subscribe(function(t){}),this.uploader.uploadAll())},t.prototype.init=function(t,e,i,n,o){void 0===n&&(n=""),void 0===o&&(o=""),this.App=t,this.K=e,this.label=i,this.tipo=n,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=o,this.ref_allegato()},t.prototype.ref_allegato=function(){var i=this;if(this.single&&null!=this.App&&""!=this.App){var t=new D;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;0<e.length&&(i.descrizione=e[0].descrizione,i.file_name=e[0].Filename,i.label_b="Download ("+e[0].Filename+" - "+e[0].Filesize+")",i.b_edit_loaded=!0)}},function(t){})}},t.decorators=[{type:l.Component,args:[{selector:"FHUpload",template:'\n <div *ngIf="loading" fxLayout="row">\nWAIT\n </div>\n <div *ngIf="enabled && !loading" fxLayout="row">\n <mat-form-field class="field_style">\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}} {{fixed_label}}">\n </mat-form-field>\n <input type="file" ng2FileSelect [uploader]="uploader" multiple />\n <div><button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button></div>\n </div>\n <div *ngIf="!enabled">\n <label>{{label}}:</label>{{descrizione}}\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Y},{type:c.ToastrService},{type:o.MatDialog},{type:R}]},t.propDecorators={enabled:[{type:l.Input}],single:[{type:l.Input}],descri_obb:[{type:l.Input}],programma_da_eseguire:[{type:l.Input}],label_attendere:[{type:l.Input}],fixed_label:[{type:l.Input}],limit_string:[{type:l.Input}],allegato_inserito:[{type:l.Input}],inserire_descrizione:[{type:l.Input}],change:[{type:l.Output}],upload_ended:[{type:l.Output}]},t}(),Q=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),W=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{styles:["\nagm-map {\n height: 600px;\n width:100%;\n}\n "],template:'\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n <mat-tab-group>\n <mat-tab label="FILTRI">\n\n\n <img src="assets/helps/fhgrid/filtri.png" />\n </mat-tab>\n <mat-tab label="ORDINAMENTI">\n <img src="assets/helps/fhgrid/ordinamenti.png" />\n </mat-tab>\n <mat-tab label="LAYOUT COLONNE">\n <img src="assets/helps/fhgrid/layout_colonne.png" />\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t}(),J=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars||this.valore.length>this.max_chars?this.toastr.error("Il valore deve avere un numero di caratteri compreso tra "+this.min_chars+" - "+this.max_chars):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}} (min {{min_chars}} - max {{max_chars}} caratteri)" type="text" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button mat-raised-button color="warn" (click)="chiudi()">ANNULLA</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Z=function(){function t(){this.filter="",this.system_dest=1}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),$=function(){function t(t,e,i,n,o,s,r){var a=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=n,this.slimLoadingBarService=o,this.m_dialog=s,this.uti_s=r,this.end_point=this.m_appService.API_ENDPOINT+this.m_appService.GRID_ENDPOINT,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.auto_height=!0,this.abilita_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.g_width="100%",this.g_height="100%",this.init_fill=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new l.EventEmitter,this.cell_edited=new l.EventEmitter,this.clicked=new l.EventEmitter,this.dclicked=new l.EventEmitter,this.columndclicked=new l.EventEmitter,this.cell_clicked=new l.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new l.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(n){a.slimLoadingBarService.start(function(){});var o=new Z;if(o.table=a.tbl_name,o.table_count=a.tbl_name,""!=a.count_tbl_name&&(o.table_count=a.count_tbl_name),console.log(n),o.num_per_pag=n.endRow-n.startRow,o.curr_page=Math.round(n.startRow/o.num_per_pag),null==o.curr_page&&(o.curr_page=0),null==o.num_per_pag&&(o.num_per_pag=100),o.sort_field=a.sort_field,null!=n.sortModel&&0<n.sortModel.length){o.sort_field="";for(var t=0;t<n.sortModel.length;t++)""!=o.sort_field&&(o.sort_field=o.sort_field+","),"autori"==n.sortModel[t].colId?o.sort_field=o.sort_field+"case when CHARINDEX('"+localStorage.getItem(a.m_appService.COMPANY_KEY+"user")+"',autori)>0 then 1 else 0 end "+n.sortModel[t].sort:o.sort_field=o.sort_field+n.sortModel[t].colId+" "+n.sortModel[t].sort}if(o.system_dest=a.system_dest,o.field=a.fields,null!=a.filters&&(o.filter=a.filters),""!=a.fix_flt&&(""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+" ("+a.fix_flt+" )"),""!=a.fix_flt_temp&&(""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+" ("+a.fix_flt_temp+" )"),null!=n.filterModel)for(var e in n.filterModel)if(null!=n.filterModel[e].type)null!=n.filterModel[e].filter&&(a.show_pulisci_filtri=!0,""!=o.filter&&(o.filter=o.filter+" and "),"number"==n.filterModel[e].filterType?("greaterThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" > "+n.filterModel[e].filter),"equals"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" = "+n.filterModel[e].filter),"notEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <> "+n.filterModel[e].filter),"lessThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" < "+n.filterModel[e].filter),"lessThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <= "+n.filterModel[e].filter),"greaterThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" >= "+n.filterModel[e].filter),"inRange"==n.filterModel[e].type&&(o.filter=o.filter+" ("+e+" >= "+n.filterModel[e].filter+" and "+e+" <= "+n.filterModel[e].filterTo+")")):("contains"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") like '%"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"startsWith"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") like '"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"equals"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") = '"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"notContains"==n.filterModel[e].type&&(o.filter=o.filter+"not upper("+e+") like '%"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"notEqual"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") <> '"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"'"),"endsWith"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") like '%"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"'"))),null==n.filterModel[e].dateTo&&null==n.filterModel[e].dateFrom||(a.show_pulisci_filtri=!0,""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+" (",null!=n.filterModel[e].dateFrom&&null!=n.filterModel[e].dateTo&&(o.filter=o.filter+e+">='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),null!=n.filterModel[e].dateTo?(null!=n.filterModel[e].dateFrom&&(o.filter=o.filter+" and "),o.filter=o.filter+e+"<='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateTo,1))+"'"):null!=n.filterModel[e].dateFrom&&("greaterThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"equals"==n.filterModel[e].type&&(o.filter=o.filter+" ("+e+" >='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"' and "+e+" <='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+" 23:59:00')"),"notEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <> '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"lessThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"lessThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"greaterThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'")),o.filter=o.filter+" )");else{a.show_pulisci_filtri=!0;var i="";for(t=0;t<n.filterModel[e].length;t++)null!=n.filterModel[e][t]&&(""!=i&&(i+=","),i=i+"'"+n.filterModel[e][t].replace("'","''")+"'");""!=i?(""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+e+" in ("+i+")"):""!=o.filter&&(o.filter=o.filter+" and 1=0")}(a.str_curr_q_p="")!=o.filter&&(a.str_curr_q_p="where "+o.filter),""!=o.sort_field&&(a.str_curr_q_p=a.str_curr_q_p+" order by "+o.sort_field),a.curr_filter=o.filter,a._gridservice.url=a.end_point,a._gridservice.doQuery(o).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){e=!0,n.successCallback(t.result_data,t.count),a.b_init=!0,a.myData=t.result_data.slice(),a.num_r=t.count,a.slimLoadingBarService.complete(),a.fill_end.emit(),localStorage.setItem(a.grid_key+"_POS1",JSON.stringify(o)),null!=localStorage.getItem(a.grid_key+"_POS2")&&null!=a.gridOptions&&null!=a.gridOptions.api&&a.gridOptions.api.forEachNode(function(t){a.getRowNodeId(t)===localStorage.getItem(a.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(a.grid_key+"_POS2"))});var i=!1;null!=a.toggle_mantieni&&(i=a.toggle_mantieni.checked),a.b_init1||i||a.autoSizeAll(),a.b_init1=!0,a.ensure_visible(),!a.show_buttons&&a.first_ref&&(a.first_ref=!1),null==localStorage.getItem(a.grid_key+"_COLS")&&setTimeout(function(){a.autoSizeAll()},300)}e||(a.errorMsg=t.msg+" ["+t.result_msg+"]")},function(t){a.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"})}},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!0,enableServerSideFilter:!0,enableColResize:!0,rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return a.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore",greaterThan:"Maggiore",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj=new Object)}return t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0))},t.prototype.edit_config=function(){var s=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(q,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[s.gf.getDescri(),s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var s=this;this.win_opt=this.m_dialog.open(J,{disableClose:!0}),this.win_opt.componentInstance.title="Salva Configurazione",this.win_opt.componentInstance.label="Nome",this.win_opt.afterClosed().subscribe(function(t){if(t&&null!=t){var e=new D;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[t,s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},t.prototype.getContextMenuItems=function(){var t=this,e=["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel",{name:"Esporta",action:function(){t.onBtExport()}}];return this.abilita_export||(e=new Array("autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel")),console.log(e),e},t.prototype.onBtExport=function(){var t={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(t){if(t.value){if(null==t.value)return"";if("function"==typeof t.value.getMonth)return this.uti_s.pad(t.value.getDate(),2)+"/"+this.uti_s.pad(t.value.getMonth()+1,2)+"/"+t.value.getFullYear();if(24==t.value.length&&-1<t.value.indexOf(":00.000Z")){console.log(new Date(t.value));var e=new Date(t.value);return this.uti_s.pad(e.getDate(),2)+"/"+this.uti_s.pad(e.getMonth()+1,2)+"/"+e.getFullYear()+" "+this.uti_s.pad(e.getHours(),2)+":"+this.uti_s.pad(e.getMinutes(),2)}return t.value}}};this.gridOptions.api.exportDataAsExcel(t)},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t?this.uti_s.newGuid():null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngOnInit=function(){this.end_point=this.m_appService.API_ENDPOINT+this.m_appService.GRID_ENDPOINT,this.end_point!=this._gridservice.url&&(this._gridservice.url=this.end_point),this.onResize()},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(W,{disableClose:!0}).afterClosed().subscribe(function(t){})},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){console.log("autoSizeAll");var e=[];this.columnDefs.forEach(function(t){e.push(t.field)}),this.gridOptions.columnApi.autoSizeColumns(e,null),this.save_cfg()},t.prototype.fitSizeAll=function(){console.log("fitSizeAll"),this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var e=0;return this.gridOptions.api.forEachNode(function(t){t.isSelected()&&e++}),e},t.prototype.getquerySelected=function(e,t){var i="";return"String"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i=i+"'"+t.data[e]+"'")}),console.log("ENTRO "+e+" "+t),"Number"==t&&(console.log("CERCO SEL"),this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(console.log("selected"),""!=i&&(i+=","),i+=t.data[e])})),i},t.prototype.selectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!0)})},t.prototype.deselectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!1)})},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(this.ric_libera=""),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;null!=this.columnDefs&&0!=this.columnDefs.length?this.ckk_ed||(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),this.init_fill&&setTimeout(function(){t.ref_dt()},100)):setTimeout(function(){t.ckk()},500)},t.prototype.res_columns=function(t){void 0===t&&(t=!1);var e=!1;if(null!=this.toggle_mantieni&&(e=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_COLS"))try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),null)}catch(i){console.log(i)}try{this.gridOptions.api.setSortModel(null)}catch(i){console.log(i)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(i){console.log(i)}try{this.gridOptions.api.setFilterModel(null)}catch(i){console.log(i)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER")){console.log(localStorage.getItem(this.grid_key+"_FILTER"));try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(i){console.log(i)}}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions?setTimeout(function(){t.ref_dt()},500):null==this.gridOptions.api?setTimeout(function(){t.ref_dt()},500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){console.log(this.header_h),this.setHeaderHeight(this.header_h),null!=this.gf&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,console.log("onready_go"),setTimeout(function(){t.ckk()},10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",void this.doFill("",!0,!1);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)2<t[i].length?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onAfterFilterChanged=function(){localStorage.removeItem(this.grid_key+"_POS"),this.b_init&&(console.log("salvo f: "+JSON.stringify(this.gridOptions.api.getFilterModel())),localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel())))},t.prototype.onFilterModified=function(){this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t),console.log("onColumnEvent: "+t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout(function(){n.ckk()},10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout(function(){i.ckk()},10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.decorators=[{type:l.Component,args:[{selector:"FHGrid",template:'<table [hidden]=\'!show_buttons\'><tr>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'><h5>{{num_r+label_elementi}}</h5>\n </td>\n <td style="vertical-align:\'bottom\'"> <mat-form-field>\n <input matInput [placeholder]="trova_label" (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera" style="width:200px">\n </mat-form-field> </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button *ngIf="show_pulisci_filtri" mat-raised-button (click)="pulisci_filtri()" color="warn"> <mat-icon>clear</mat-icon> REMOVE FILTER</button>\n </td> <td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button mat-raised-button (click)="autoSizeAll()" color="accent"> <mat-icon>photo_size_select_small</mat-icon> AUTO SIZE</button>\n </td> <td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button mat-raised-button (click)="fitSizeAll()" color="accent"> <mat-icon>aspect_ratio</mat-icon> FIT SIZE</button>\n <td *ngIf="show_buttons && !this.m_appService.getState( ).mobile">\n <div fxLayout="row" fxLayoutAlign="center center">\n \n <FHComboBox (selchange)="ch_config()" (fillend)="fe_cfg()" #gf init_fill="false"></FHComboBox>\n \n <div matTooltip="Modifica Preferenza" matTooltipPosition="above">\n <button [hidden]=\'this.m_appService.getState().pageFullscreen\' mat-icon-button *ngIf="curr_config!=\'-1\'" style="color:rgb(248, 105, 10)">\n <mat-icon (click)="edit_config()" >save</mat-icon>\n </button> </div> \n <div matTooltip="Crea Nuova Preferenza" matTooltipPosition="above">\n <button [hidden]=\'this.m_appService.getState().pageFullscreen\' mat-icon-button style="color:rgb(16, 98, 16)">\n <mat-icon (click)="insert_config()">library_add</mat-icon>\n </button></div> <mat-slide-toggle [hidden]=\'this.m_appService.getState().pageFullscreen\' (click)="ck_flag()" #toggle_mantieni >{{mantieni_impostazioni}}</mat-slide-toggle>\n \n\n </div>\n\n </td><td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> \n <button *ngIf="show_help" mat-raised-button (click)="help_window()" color="accent"> <mat-icon>help</mat-icon> HELP</button>\n </td>\n\n\n </tr>\n </table>\n <div [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="!show_buttons && !this.m_appService.getState( ).mobile && show_num_elem"><h5>{{num_r+\' Elementi\'}}</h5></div>\n\n <ag-grid-angular ref-agGrid (cellDoubleClicked)="onColumnEvent($event)" (cellClicked)="onCellClicked($event)" [headerHeight]="header_h" [groupHeaderHeight]="header_h"\n class="ag-theme-balham" [singleClickEdit]="true" style="width: 100%; height: 100%;" [gridOptions]="gridOptions" [columnDefs]="columnDefs"\n [rowData]="rowData" enableColResize enableServerSideSorting enableServerSideFilter enableColResize\n (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()" (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)" (columnVisible)="oncolumnEverythingChanged($event)" (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)" (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()" [paginationPageSize]="num_per_pag" (gridReady)="onReady($event)">\n </ag-grid-angular>\n',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Q},{type:c.ToastrService},{type:Y},{type:R},{type:_.SlimLoadingBarService},{type:o.MatDialog},{type:P}]},t.propDecorators={end_point:[{type:l.Input}],tbl_name:[{type:l.Input}],columnDefs:[{type:l.Input}],count_tbl_name:[{type:l.Input}],num_per_pag:[{type:l.Input}],grid_key:[{type:l.Input}],sort_field:[{type:l.Input}],fields:[{type:l.Input}],filters:[{type:l.Input}],auto_height:[{type:l.Input}],abilita_export:[{type:l.Input}],enabled_pag:[{type:l.Input}],show_help:[{type:l.Input}],show_num_elem:[{type:l.Input}],system_dest:[{type:l.Input}],header_h:[{type:l.Input}],g_width:[{type:l.Input}],g_height:[{type:l.Input}],init_fill:[{type:l.Input}],label_elementi:[{type:l.Input}],trova_label:[{type:l.Input}],mantieni_impostazioni:[{type:l.Input}],show_buttons:[{type:l.Input}],fill_end:[{type:l.Output}],cell_edited:[{type:l.Output}],clicked:[{type:l.Output}],dclicked:[{type:l.Output}],columndclicked:[{type:l.Output}],cell_clicked:[{type:l.Output}],gf:[{type:l.ViewChild,args:["gf"]}],toggle_mantieni:[{type:l.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:l.Output}],off_set:[{type:l.Input}],onResize:[{type:l.HostListener,args:["window:resize",["event"]]}],testom:[{type:l.ViewChild,args:["testom",{read:l.ViewContainerRef}]}],myModalNormal:[{type:l.ViewChild,args:["myModalNormal",{read:l.ViewContainerRef}]}]},t}(),X=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.types=new Array,this.values=new Array,this.label="",this.width="100%",this.enabled=!0,this.sel_label="",this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1"}return t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1"},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array},t.prototype.fillCombo=function(){var i=this;if(console.log("fillcombo "+this.sql),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var t=new D;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.sql+"]"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.sql+"]"})}else this.set_options(this.sql)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return void(this.selval=""+this.myData[e].valore)},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t){this.selval=""+this.myData[e].valore;break}},t.prototype.getDescri=function(){if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){return null==this.selval?"-1":""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){},t.prototype.ngOnInit=function(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.sc=function(){console.log("-----------sc---------------"),this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.decorators=[{type:l.Component,args:[{selector:"FHComboBox",template:'\n<mat-form-field>\n <mat-select placeholder="{{label}}" #cmb [disabled]="!enabled" [(ngModel)]="selval" (selectionChange)="sc()" style="width:100%;">\n <mat-option value="-1">{{sel_label}}</mat-option>\n <mat-option value="{{app.valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</mat-option>\n </mat-select>\n </mat-form-field>\n',styles:["\n\n"]}]}],t.ctorParameters=function(){return[{type:Y},{type:w}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],label:[{type:l.Input}],width:[{type:l.Input}],enabled:[{type:l.Input}],sel_label:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}],valDef:[{type:l.Input}],db_type:[{type:l.Input}]},t}(),tt=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.label="",this.types=new Array,this.values=new Array,this.db_type="1",this.enabled=!0,this.only_from_list=!1,this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.focusout=new l.EventEmitter,this.sItem="",this.searchItemsFiltered=new Array,this.is_loaded=!1,this.selval=null,this.errorMsg="",this.valDef="",this.table_hidden=!0}return t.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},t.prototype.fo_search=function(){this.focusout.emit()},t.prototype.onChange=function(t){if(this.searchItemsFiltered=new Array,null!=this.sItem)if(""!=this.sItem){this.searchItemsFiltered=new Array;for(var e=this.sItem.toLowerCase(),i=0;i<this.myData.length&&(null!=this.myData[i].descrizione_valore&&-1!=this.myData[i].descrizione_valore.toLowerCase().indexOf(e)&&this.searchItemsFiltered.push(this.myData[i]),20!=this.searchItemsFiltered.length);i++);}else for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},t.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.selchange.emit({event:t,valore:this.getValue(),descrizione_valore:this.getDescri()})},t.prototype.myListFormatter=function(t){return t.descrizione_valore},t.prototype.resetValue=function(){var t=this;setTimeout(function(){t.selval="",t.valDef="",t.sItem="",t.selval=null},100)},t.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},t.prototype.fillCombo=function(){var i=this;this.myData=new Array,this.searchItemsFiltered=new Array;var t=new D;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.prototype.resetD=function(t){this.myData=t,this.selval="",this.fillend.emit(),this.table_hidden=!1,this.errorMsg="",this.setByValue(this.valDef),this.is_loaded=!0,null!=this.getValue()&&""!=this.getValue()||""==this.valDef||this.setByDescri(this.valDef)},t.prototype.setByDescri=function(t){if(this.valDef=t,(this.selval="")!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.sItem=t,void(this.selval=this.myData[e].valore);this.only_from_list||(this.sItem=t)}},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval=t,null!=this.myData)for(var e in this.myData)if(this.myData[e].valore==this.selval){this.sItem=this.myData[e].descrizione_valore;break}},t.prototype.getDescri=function(){return this.getData("descrizione_valore")},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.only_from_list||"descrizione_valore"!=t?null:this.sItem},t.prototype.getObj=function(){for(var t in this.myData)if(this.myData[t].valore==this.selval)return this.myData[t];return null},t.prototype.getValue=function(){return this.getData("valore")},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.table_hidden=!1,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngOnInit=function(){if(this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHAutoComplete",template:'\n<mat-form-field class="field_style">\n<input matInput class="field_style" [disabled]="!enabled" [matAutocomplete]="auto" [placeholder]="label" (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search()" #searchp >\n</mat-form-field>\n<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)">\n<mat-option *ngFor="let objx of searchItemsFiltered" class="search_home" [value]="objx.descrizione_valore" >\n\n {{ objx.descrizione_valore }}\n</mat-option>\n</mat-autocomplete>\n\n\n <div class="ui negative message" *ngIf="errorMsg != \'\'">\n <i class="close icon"></i>\n <div class="header">\n {{errorMsg}}\n </div>\n </div>\n'}]}],t.ctorParameters=function(){return[{type:Y},{type:w}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],label:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],db_type:[{type:l.Input}],enabled:[{type:l.Input}],only_from_list:[{type:l.Input}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}],focusout:[{type:l.Output}],searchp:[{type:l.ViewChild,args:["searchp"]}],auto:[{type:l.ViewChild,args:["auto"]}]},t}(),et=function(){function t(t,e){this.dateAdapter=t,this.uti_s=e,this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new l.EventEmitter,this.v_view=this.uti_s.date2String(new Date),this.date_sel=null,this.v_date_sel="",this.dateAdapter.setLocale("it")}return t.prototype.dt_chg=function(t){console.log(t);var e=t.split("/");3==e.length&&parseInt(e[2])<3e3&&0<parseInt(e[0])&&parseInt(e[0])<=31&&1<parseInt(e[1])&&parseInt(e[1])<=12&&(this.date_sel=new Date(parseInt(e[2]),parseInt(e[1])-1,parseInt(e[0])))},t.prototype.chxx=function(t){console.log(t)},t.prototype.ch=function(t){this.change.emit(this.getValue())},t.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},t.prototype.dt_ch=function(){var t=this;setTimeout(function(){console.log(t.date_sel),t.change.emit()},50)},t.prototype.add_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,this.date_sel.getMonth(),this.date_sel.getDate()),this.v_view=this.uti_s.date2String(this.date_sel),this.change.emit(this.getValue())},t.prototype.ini_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.date_sel),this.change.emit(this.getValue())},t.prototype.fin_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.date_sel),this.change.emit(this.getValue())},t.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){this.dateAdapter.setLocale("it"),null!=t?(null!=t.value&&(t=new Date(t.value)),this.date_sel=new Date(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.date_sel)):this.date_sel=null},t.decorators=[{type:l.Component,args:[{selector:"FHDatePicker",providers:[{provide:o.MAT_DATE_LOCALE,useValue:"it-IT"}],template:'\n<div [hidden]="!show_buttons||!enabled"><button mat-raised-button (click)="add_year()">+1 Anno</button>\n<button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n<button mat-raised-button (click)="fin_year()">Fine Anno</button>\n</div>\n\n<mat-form-field (click)="chxx($event)">\n<input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event.target.value)" (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" placeholder="{{label}}">\n<mat-datepicker-toggle matSuffix [for]="picker" (click)="chxx($event)"></mat-datepicker-toggle>\n<mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>\n</mat-form-field>\n\n',styles:["\n .lb_small_grigia{\n font-size: 12px;\n color: #B8B8B8;\n}\n .label_dis{\n font-size: 14px;\n font-weight: bold;\n}\n"]}]}],t.ctorParameters=function(){return[{type:o.DateAdapter},{type:P}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],pickerId:[{type:l.ViewChild,args:["pickerId"]}]},t}(),it=function(){function t(t,e,i){this._dataService=t,this.dialogRef=e,this.toastr=i,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.single_sel=!1,this.vis_buttons=!0,this.all_users=!1,this.user_sel=new Array}return t.prototype.filtra=function(){this.users_list_sel=new Array;for(var t=0;t<this.users_list.length;t++)if(null!=this.users_list[t].nc){var e=!1;console.log(this.users_list[t].username),console.log(this.users_list_sel);for(var i=0;i<this.users_list_sel.length;i++)if(this.users_list_sel[i].username==this.users_list[t].username){e=!0;break}if(console.log(e),!e&&(-1!=this.users_list[t].nc.toUpperCase().indexOf(this.fltr_user.toUpperCase())||""==this.fltr_user))if(console.log("this.user_sel"),console.log(this.user_sel),null==this.user_sel)this.users_list_sel.push(this.users_list[t]);else{for(var n=!1,o=0;o<this.user_sel.length;o++)if(this.user_sel[o].username==this.users_list[t].username){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}console.log("this.users_list_sel"),console.log(this.users_list_sel)},t.prototype.ngOnInit=function(){var e=this;if(this.all_users){var t=new D;t.sql="SELECT_ALL_USERS",t.types=[],t.values=[],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.users_list=t.result_data,e.filtra())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})}else{if(null!=this.user_sel&&0<this.user_sel.length)return;if(this.users_list_sel=new Array,null!=this.users_list)for(var i=0;i<this.users_list.length;i++)this.users_list_sel.push(this.users_list[i])}},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&this.users_list.splice(t,1),this.single_sel&&(this.user_sel=new Array),this.user_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.user_sel.indexOf(this.selectedRemove,0);-1<t&&this.user_sel.splice(t,1),this.users_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelArr=function(){return this.user_sel},t.decorators=[{type:l.Component,args:[{selector:"FHPickUsers",template:'\n <mat-card>\n <mat-card-content>\n <div fxLayout="row" fxFlex >\n <div fxLayout="column" fxFlex="41%">\n\n <div style="text-align: center;">\n <b>Seleziona Utenti</b>\n </div>\n <br><br>\n <div fxLayout="row">\n <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()" style=\'padding:8px;margin:15px auto;width:100%;\' placeholder=\'Ricerca...\'>\n\n </div>\n <div style="width:100%;height:250px;overflow:auto;">\n <section class="bs">\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of users_list_sel" (click)="addTo(u)" (dblclick)="do_add()" class="selector" [ngClass]="{ \'active\': selectedAdd == u }">\n <td>{{u.nc}} {{u.canale}}</td>\n\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n </div>\n <div fxLayout="column" fxFlex="18%" style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-raised-button (click)="do_add()" [disabled]="!option"><mat-icon>arrow_forward</mat-icon> </button>\n <br><br>\n <button mat-raised-button (click)="do_rem()" [disabled]="option"> <mat-icon>delete</mat-icon> </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n <div style="text-align: center;">\n <b>Utenti Selezionati</b>\n </div>\n <br><br>\n <div style="width:100%;height:250px;overflow:auto;">\n <section class="bs">\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of user_sel" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector" [ngClass]="{ \'active\': selectedRemove == u }">\n <td>{{u.nc}} {{u.canale}}</td>\n\n </tr>\n </tbody>\n </table></section>\n </div>\n </div>\n </div>\n <br>\n <div style="text-align: center;" *ngIf="vis_buttons" >\n <button mat-raised-button color="primary" (click)="dialogRef.close(false)">Ok</button>\n <button mat-raised-button (click)="dialogRef.close(false)">Annulla</button>\n </div>\n </mat-card-content>\n\n</mat-card>\n',styles:["\n .selector:hover{\n background-color:#fafafa;\n cursor:pointer;\n }\n .active{\n background-color:#fafafa;\n cursor:pointer;\n }\n .fabeOut{\n display: block;\n background-color: rgba(0,0,0,.5);\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n\n pointer-events: auto;\n -webkit-transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n }\n .cardFloat{\n\n }\n\n"]}]}],t.ctorParameters=function(){return[{type:Y},{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={users_list:[{type:l.Input}],users_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],all_users:[{type:l.Input}],user_sel:[{type:l.Input}]},t}(),nt=function(){function t(){this.val_app=-1}return t.prototype.ok=function(){this.val_app=1,this.params.api.stopEditing()},t.prototype.ko=function(){this.val_app=0,this.params.api.stopEditing()},t.prototype.nd=function(){this.val_app=-1,this.params.api.stopEditing()},t.prototype.ngAfterViewInit=function(){},t.prototype.agInit=function(t){this.params=t},t.prototype.getValue=function(){return this.val_app},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"approva-cell",template:'\n <div #container class="mood">\n\n <div class="example-mat-buttons">\n \n <button mat-icon-button style="color:green" (click)="ok()">\n <mat-icon>thumb_up</mat-icon>\n </button>\n <button mat-icon-button style="color:red" (click)="ko()">\n <mat-icon>thumb_down</mat-icon>\n </button>\n <button mat-icon-button style="color:gray" (click)="nd()">\n <mat-icon>crop_din</mat-icon>\n </button>\n </div>\n\n \n </div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n \n \n "]}]}],t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}]},t}(),ot=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.THOUSANDS_SEPARATOR))+s},t.prototype.parse=function(t,e){void 0===e&&(e=2);var i=x((t||"").split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return n=n.replace(new RegExp(this.THOUSANDS_SEPARATOR,"g"),""),s=0<parseInt(s,10)&&0<e?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",t},t.decorators=[{type:l.Pipe,args:[{name:"FHCurrency"}]}],t.ctorParameters=function(){return[]},t}(),st=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngOnInit=function(){this.el.value=this.currencyPipe.transform(this.el.value)},t.prototype.onFocus=function(t){this.el.value=this.currencyPipe.parse(t)},t.prototype.onBlur=function(t){this.el.value=this.currencyPipe.transform(t)},t.decorators=[{type:l.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],t.ctorParameters=function(){return[{type:l.ElementRef},{type:ot}]},t.propDecorators={onFocus:[{type:l.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:l.HostListener,args:["blur",["$event.target.value"]]}]},t}(),rt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title="",this.sql_dett="",this.descri="",this.lat=51.673858,this["long"]=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],null!=this.m_appService.getState().appo_dialog&&(null!=this.m_appService.getState().appo_dialog.zoom&&(this.zoom=this.m_appService.getState().appo_dialog.zoom),null!=this.m_appService.getState().appo_dialog.title&&(this.title=this.m_appService.getState().appo_dialog.title),null!=this.m_appService.getState().appo_dialog.lat&&(this.lat=this.m_appService.getState().appo_dialog.lat),null!=this.m_appService.getState().appo_dialog["long"]&&(this["long"]=this.m_appService.getState().appo_dialog["long"]),null!=this.m_appService.getState().appo_dialog.descri&&(this.descri=this.m_appService.getState().appo_dialog.descri),null!=this.m_appService.getState().appo_dialog.markers&&(this.markers=this.m_appService.getState().appo_dialog.markers),console.log("zoom: "+this.zoom))}return t.prototype.apri_Scheda=function(t){console.log(t),window.open(t)},t.prototype.clickedMarker=function(t,e,i){this.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{styles:["\nagm-map {\n height: 600px;\n width:100%;\n}\n "],template:'\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n\n <agm-map [zoom]="zoom" width="100%" height="100%" [latitude]="lat" [longitude]="long">\n <agm-marker\n *ngFor="let m of markers; let i = index"\n (markerClick)="clickedMarker(m.labelx, infoWindow, i)"\n [latitude]="m.lat"\n [longitude]="m.lng"\n [label]="m.label"\n >\n <agm-info-window #infoWindow>\n\n <strong>{{m.labelx}}</strong><br>\n <button *ngIf="m.url_scheda!=null" (click)="apri_Scheda(m.url_scheda)">APRI SCHEDA</button>\n </agm-info-window>\n </agm-marker>\n </agm-map>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t}(),at=function(){function t(){this.text="",this.date_zz="",this.date_v="",this.label=""}return t.prototype.setDt=function(){this.date_zz=this.text},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout(function(){return t.appdt.nativeElement.focus()},500)},t.prototype.agInit=function(t){return null==(this.params=t).value?(this.text=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.text=null,void(this.date_zz=null)):(this.text=t.value,void(this.date_zz=t.value))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&13!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood" >\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field>\n <textarea matInput style="min-height:180px;min-width:400px" [(ngModel)]="text" #appdt placeholder="{{label}}"></textarea>\n </mat-form-field>\n </div>\n\n <button mat-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n .default {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n .selected {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),lt=function(){function t(t){this._dataService=t,this.selval="",this.date_zz="",this.date_v="",this.sql="",this.label="",this.myData=new Array}return t.prototype.setDt=function(){this.date_zz=this.selval},t.prototype.ngAfterViewInit=function(){},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new D;i.sql=t.sql,i.types=t.types,i.values=t.values,this._dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data)},function(t){}),null!=t.value&&-1==t.value.indexOf("--")&&(this.selval=t.value,this.date_zz=t.value)},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){t.which||t.keyCode},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood" >\n <div style="min-width:350px;min-height:60px;text-align=center" >\n\n <select [(ngModel)]="selval" #appdt style="min-height:40px;width:90%">\n <option value="{{app.descrizione_valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</option>\n </select>\n </div>\n <br><br><br>\n <button mat-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n .default {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n .selected {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],t.ctorParameters=function(){return[{type:Y}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),pt=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.label="",this.enabled=!0,this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.upd_f=function(t,e){var i=new Object;i.u=t,i.b=e,this.selchange.emit(i)},t.prototype.resetValue=function(){for(var t=0;t<this.myData.length;t++)this.myData[t].checked=!1},t.prototype.reset=function(){this.myData=new Array,this.resetValue()},t.prototype.fillCombo=function(){var e=this;if(console.log(this.init_fill),this.init_fill){console.log("fillcombolist");var t=new D;t.sql=this.sql,t.types=this.types,t.values=this.values,this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data,e.resetValue(),e.setByValue(e.valDef),"-1"==e.getValue()&&"-1"!=e.valDef&&e.setByDescri(e.valDef),e.fillend.emit())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+e.sql+"]"})}},t.prototype.setByDescri=function(t){if(console.log("setByDescri "+t),null!=(this.valDef=t)&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){var e=t.split(",");console.log("arr_val "+e.length);for(var i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].descrizione_valore==e[n]&&(this.myData[i].checked=!0)}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.setByValue=function(t){if(null!=(this.valDef=t)&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(","),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.getDescri=function(){for(var t="",e=0;e<this.myData.length;e++)console.log(this.myData[e].checked);for(e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=","),t+=this.myData[e].descrizione_valore);return console.log("getDescri: "+t),t},t.prototype.getObjects=function(){for(var t=new Array,e=0;e<this.myData.length;e++)this.myData[e].checked&&t.push(this.myData[e]);return t},t.prototype.getValue=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=","),t+=this.myData[e].valore);return t},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],n.checked=!1,this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){this.selchange.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHList",template:'\n\n\n<div style="width:100%;">\n<section class="bs">\n <table>\n <tr><th></th><th>\n {{label}}\n\n </th></tr>\n <tbody>\n\n <tr *ngFor="let u of myData" class="selector">\n <td style="width:20px"> <mat-slide-toggle (change)="upd_f(u,$event)" [disabled]="!enabled" [(ngModel)]="u.checked"></mat-slide-toggle></td>\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table></section>\n</div>\n\n\n',styles:["\n\n\n"]}]}],t.ctorParameters=function(){return[{type:Y}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}]},t}(),ct=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label=""}return t.prototype.set_selection=function(t,e){this.label=t;for(var i=0;i<e.length;i++)this.cmb_sel.add_option(e[i])},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObj()):this.toastr.error("Selezionare un valore")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\nSELEZIONA {{label|uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px"> \n<FHComboBox #cmb_sel [init_fill]="false" ></FHComboBox>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),ut=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t.decorators=[{type:l.Pipe,args:[{name:"replaceLineBreaks"}]}],t}(),ht=function(){function t(){this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new l.EventEmitter,this.myDatePickerOptions={width:"150px",dateFormat:"dd/mm/yyyy",dayLabels:{su:"Dom",mo:"Lun",tu:"Mar",we:"Mer",th:"Gio",fr:"Ven",sa:"Sab"},monthLabels:{1:"Gen",2:"Feb",3:"Mar",4:"Apr",5:"Mag",6:"Giu",7:"Lug",8:"Ago",9:"Set",10:"Ott",11:"Nov",12:"Dic"}},this.date_sel=null}return t.prototype.setFocus=function(){console.log("set focus"),this.dtc.setFocusToInputBox()},t.prototype.dt_ch=function(){var t=this;console.log("dt_ch!!"),console.log(this.dtc),setTimeout(function(){console.log(t.date_sel),t.change.emit()},50)},t.prototype.add_year=function(){this.date_sel={date:{year:this.date_sel.date.year+1,month:this.date_sel.date.month,day:this.date_sel.date.day}},this.change.emit()},t.prototype.ini_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:1,day:1}},this.change.emit()},t.prototype.fin_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:12,day:31}},this.change.emit()},t.prototype.getValue=function(){return null==this.date_sel?null:new Date(this.date_sel.date.year,this.date_sel.date.month-1,this.date_sel.date.day)},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.getCopyOfOptions=function(){return JSON.parse(JSON.stringify(this.myDatePickerOptions))},t.prototype.setLimits=function(){var t=this.getCopyOfOptions();null!=this.min_date&&(this.min_date.setDate(this.min_date.getDate()-1),t.disableUntil={year:this.min_date.getFullYear(),month:this.min_date.getMonth()+1,day:this.min_date.getDate()}),null!=this.max_date&&(this.max_date.setDate(this.max_date.getDate()+1),t.disableSince={year:this.max_date.getFullYear(),month:this.max_date.getMonth()+1,day:this.max_date.getDate()}),this.myDatePickerOptions=t},t.prototype.setToday=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:(new Date).getMonth()+1,day:(new Date).getDate()}}},t.prototype.setValue=function(t){this.date_sel=null!=t?{date:{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}}:null},t.decorators=[{type:l.Component,args:[{selector:"DtPicker",template:'\n<div [hidden]="!show_buttons||!enabled"><button mat-raised-button (click)="add_year()">+1 Anno</button>\n<button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n<button mat-raised-button (click)="fin_year()">Fine Anno</button>\n</div>\n\n<div class="lb_small_grigia">{{label}}</div>\n<my-date-picker (dateChanged)="dt_ch()" #appdt [options]="myDatePickerOptions" *ngIf="enabled" [(ngModel)]="date_sel"></my-date-picker>\n\n<div *ngIf="!enabled" class="label_dis" >{{this.date_sel?.date.day}}/{{this.date_sel?.date.month}}/{{this.date_sel?.date.year}}</div>\n',styles:["\n .lb_small_grigia{\n font-size: 12px;\n color: #B8B8B8;\n}\n .label_dis{\n font-size: 14px;\n font-weight: bold;\n}\n"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],dtc:[{type:l.ViewChild,args:["appdt"]}]},t}(),dt=function(){function t(t,e,i){this.dialogRef=t,this._dataService=e,this.toastr=i,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.value_list=new Array,this.value_list_all=new Array,this.value_list_sel=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.types=[],this.values=[],this.value_sel=new Array}return t.prototype.ngOnInit=function(){},t.prototype.filtra=function(){if(this.value_list_sel=new Array,""==this.fltr_user){for(var t=0;t<this.value_list_all.length;t++)if(this.value_list_sel.push(this.value_list_all[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_list_all.length;t++)if(-1!=this.value_list_all[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())){for(var e=!1,i=0;i<this.value_list_sel.length;i++)if(this.value_list_sel[i].descrizione_valore==this.value_list_all[t].descrizione_valore){e=!0;break}if(e||this.value_list_sel.push(this.value_list_all[t]),50==this.value_list_sel.length&&this.limit_size)return}},t.prototype.fill_list=function(t,e){var n=this;this.value_sel=new Array;for(var i=0;i<e.length;i++){var o=new Object;o.descrizione_valore=e[i],this.value_sel.push(o)}var s=new D;s.sql=t,s.types=this.types,s.values=this.values,this._dataService.doQuery(s).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){n.value_list_all=t.result_data,console.log(n.value_list_all);for(var e=0;e<n.value_sel.length;e++)for(var i=n.value_list_all.length-1;0<=i;i--)if(n.value_list_all[i].descrizione_valore==n.value_sel[e].descrizione_valore){n.value_list_all.splice(i,1);break}n.filtra()}},function(t){n.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list_all.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&this.value_list_all.splice(t,1),this.single_sel&&(this.value_sel=new Array),this.value_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra(),this.single_sel&&this.ok()}else this.toastr.error("ERRORE","Selezionare il valore da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.value_sel.indexOf(this.selectedRemove,0);-1<t&&this.value_sel.splice(t,1),this.value_list_all.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare il valore da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return console.log("aa >="+t),t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t.decorators=[{type:l.Component,args:[{selector:"FHPickList",template:'\n <mat-card style="width:600px;">\n <mat-card-content style="width:600px;">\n <div fxLayout="column" fxLayoutGap="15px" fxFlex style="width:600px;height:400px">\n <div fxLayout="row" style="width:550">\n <div fxLayout="column" fxFlex="41%">\n\n <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()" style=\'padding:8px;margin:15px auto;width:100%;\' placeholder=\'Ricerca...\'>\n <div style="width:100%;height:250px;overflow:auto;">\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of value_list_sel" (click)="addTo(u)" (dblclick)="do_add()" class="selector" [ngClass]="{ \'active\': selectedAdd == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div fxLayout="column" fxFlex="18%" style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-raised-button (click)="do_add()" [disabled]="!option"><mat-icon>arrow_forward</mat-icon> </button>\n <br><br>\n <button mat-raised-button (click)="do_rem()" [disabled]="option"> <mat-icon>delete</mat-icon> </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n <div style="text-align: center;">\n <b>Valori Selezionati</b>\n </div>\n\n <div style="width:100%;height:250px;overflow:auto;">\n\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of value_sel" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector" [ngClass]="{ \'active\': selectedRemove == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br><br>\n<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-raised-button color="primary" (click)="ok()">Ok</button>\n <button mat-raised-button (click)="dialogRef.close()">Annulla</button>\n</div>\n</div>\n </mat-card-content>\n\n</mat-card>\n',styles:["\n .selector:hover{\n background-color:#fafafa;\n cursor:pointer;\n }\n .active{\n background-color:#fafafa;\n cursor:pointer;\n }\n .fabeOut{\n display: block;\n background-color: rgba(0,0,0,.5);\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n\n pointer-events: auto;\n -webkit-transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n }\n .cardFloat{\n\n }\n\n"]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:Y},{type:c.ToastrService}]},t.propDecorators={value_list:[{type:l.Input}],value_list_all:[{type:l.Input}],value_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],limit_size:[{type:l.Input}],value_sel:[{type:l.Input}]},t}(),_t=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.valore_min=1,this.valore_max=1e6}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){Number(this.valore)<this.valore_min||Number(this.valore)>this.valore_max?this.toastr.error("Il valore deve avere essere compreso tra "+this.valore_min+" - "+this.valore_max):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}}" type="number" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button mat-raised-button color="warn" (click)="chiudi()">ANNULLA</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t}(),gt=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.path_md=""}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"FHMdReader",template:'\n <markdown [src]="path_md">\n\n</markdown>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Y},{type:w}]},t.propDecorators={path_md:[{type:l.Input}]},t}(),mt=function(){function t(){}return t.decorators=[{type:l.Component,args:[{selector:"FHLogPanel",template:'\n\n\n <div style="width:100%;">\n <section class="bs">\n\x3c!--\n\n <FHGrid [init_fill]="false" #dtm [show_buttons]="false" [auto_height]="false" [g_height]="g_height" [columnDefs]="columnDefs" tbl_name="logs" grid_key="logs" sort_field="data desc"></FHGrid>\n--\x3e\n\n </section>\n </div>\n\n\n ',styles:["\n\n\n "]}]}],t}(),ft=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars?this.toastr.error("Il valore deve contenere almeno "+this.min_chars+" caratteri"):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="width:600px" >\n <mat-form-field>\n <textarea matInput placeholder="{{label}}" type="text" [(ngModel)]="valore" style="width:600px" rows="15" required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button mat-raised-button color="warn" (click)="chiudi()">ANNULLA</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),vt={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return yt}),multi:!0},yt=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.change=new l.EventEmitter,this.innerValue=0,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout(function(){t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),t.onChange(t.value)},50)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal),this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transformAmount=function(t){var e=this;try{setTimeout(function(){e.value=parseFloat(e.formattedAmount.split(".").join("").split(",").join(".")),e.formattedAmount=e.transform(e.value,e.decimal)},50)}catch(i){console.log(i)}},t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHCurrencyField",providers:[vt],template:'\n <mat-form-field [hidden]="hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event)"\n (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"\n pattern="[0-9]+">\n </mat-form-field>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),bt={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return It}),multi:!0},It=function(){function t(){this.enabled=!0,this.value="",this.height="360",this.change=new l.EventEmitter,this.focus=new l.EventEmitter,this.blur=new l.EventEmitter,this.config=new Object,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onFocus=function(t){this.focus.emit(t)},t.prototype.onBlur=function(t){this.blur.emit(t)},t.prototype.ngOnInit=function(){this.config={height:this.height},console.log("this.enabled"),console.log(this.enabled),this.enabled?(console.log("enabled"+this.enabled),this.config.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}]):(this.config.allowedContent=!0,this.config.toolbarGroups=[])},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.decorators=[{type:l.Component,args:[{selector:"FHRichText",providers:[bt],template:'\n <ckeditor #ced\n [(ngModel)]="value"\n [config]="config"\n [readonly]="!enabled"\n (change)="writeValue($event)"\n (focus)="onFocus($event)"\n (blur)="onBlur($event)" ngDefaultControl\n debounce="500">\n </ckeditor>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={enabled:[{type:l.Input}],value:[{type:l.Input}],height:[{type:l.Input}],change:[{type:l.Output}],focus:[{type:l.Output}],blur:[{type:l.Output}],ced:[{type:l.ViewChild,args:["ced"]}]},t}(),St=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_output",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <textarea matInput >{{valore}}</textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Et={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Ot}),multi:!0},Ot=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.change=new l.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){""!=this.formattedAmount?this.value=this.uti_s.round(parseFloat(this.formattedAmount.split(".").join("").split(",").join(".")),this.decimal):this.value=this.uti_s.round(0,this.decimal),this.formattedAmount=this.transform(this.value,this.decimal),this.chgf=!0,this.onChange(this.value)},t.prototype.writeValue=function(t){this.chgf?this.chgf=!1:(console.log("writeValue "+t+" "+this.decimal),null==t&&(t=0),t!==this.innerValue&&(this.innerValue=t,this.value=t,console.log("prima "+this.formattedAmount),this.formattedAmount=this.transform(this.value,this.decimal),console.log("dopo "+this.formattedAmount)))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transform=function(t,e){void 0===e&&(e=0),console.log("transform "+t+" "+e);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),console.log(n+s),n+s},t.prototype.removeCurrencyPipeFormat=function(t){console.log("removeCurrencyPipeFormat "+this.value);try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),console.log("tttttttttttt",this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHNumericField",providers:[Et],template:'\n <mat-form-field [hidden]="hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="chg()"\n (focus)="removeCurrencyPipeFormat($event)"\n pattern="[0-9]+">\n </mat-form-field>\n\n',styles:["\n\n"]}]}],t.ctorParameters=function(){return[{type:P}]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),Rt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.sql=""}return t.prototype.doFill=function(){this.cmb_sel.sql=this.sql,this.cmb_sel.types=this.types,this.cmb_sel.values=this.values,this.cmb_sel.fillCombo()},t.prototype.ok=function(){""!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObjects()):this.toastr.error("Selezionare un valore")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\n {{label|uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <FHList #cmb_sel [label]="" style="width:100%;min-height:90px" init_fill="false" ></FHList>\n\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),wt={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Ct}),multi:!0},Ct=function(){function t(t,e,i){this.dataservice=t,this.dialog=e,this.toast=i,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.change=new l.EventEmitter,this.select=new l.EventEmitter,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this.required&&(this.label=this.label+" *")},Object.defineProperty(t.prototype,"userName",{get:function(){return this.selectedUser?this.selectedUser.cognome+" "+this.selectedUser.nome:""},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){console.log("writevalue "+t),null!=t&&""!=t&&("noop"!=t?null!=this.selectedUser?this.selectedUser.username!=t&&this.setByUsername(t):this.setByUsername(t):this.onChange(this.selectedUser.username))},t.prototype.setByUsername=function(t){var e=this;if(t){var i={sql:"SELECT_USER_BY_USERNAME",types:["string"],values:[t],names:[]};this.dataservice.doQuery(i).subscribe(function(t){console.log(t),t.result_data.length<1?e.clear():(e.selectedUser=t.result_data[0],e.onChange(e.selectedUser.username),e.change.emit(e.selectedUser))})}},t.prototype.setById=function(t){var e=this;if(t){var i={sql:"SELECT_USER_BY_ID",types:["string"],values:[t],names:[]};this.dataservice.doQuery(i).subscribe(function(t){console.log(t),t.result_data.length<1?e.clear():(e.selectedUser=t.result_data[0],e.onChange(e.selectedUser.username),e.change.emit(e.selectedUser))})}},t.prototype.open_pick=function(){var e=this,t=this.dialog.open(dt,{disableClose:!0});t.componentInstance.fill_list("SELECT_ALL_USERS",[]),t.componentInstance.single_sel=!0,t.afterClosed().subscribe(function(t){null!=t&&(e.clear(),0<t.length&&(e.selectedUser=t[0],e.writeValue("noop"),e.select.emit(e.selectedUser)))})},t.prototype.clear=function(){this.selectedUser=null,this.onChange(null),this.change.emit(this.selectedUser),this.select.emit(this.selectedUser)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.decorators=[{type:l.Component,args:[{selector:"FHUserField",providers:[wt],template:'\n <mat-form-field>\n <button class="clickable-field" (click)="open_pick()">\n <input matInput\n [hidden]="hidden"\n [placeholder]="label"\n type="text"\n [ngModel]="userName"\n disabled></button>\n <button mat-icon-button\tmatSuffix\n [hidden]="!selectedUser"\n (click)="clear()"><mat-icon>clear</mat-icon></button>\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n text-align: left;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}]}],t.ctorParameters=function(){return[{type:Y},{type:o.MatDialog},{type:c.ToastrService}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],select:[{type:l.Output}]},t}(),At=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i}return t.prototype.salva_esci=function(){this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n\n<br>\n<div style="width:100%;text-align:center;">\n<button mat-raised-button color="primary" (click)="salva_esci()">SALVA ED ESCI</button>\n <button mat-raised-button color="warn" (click)="esci_senza_salv()">ESCI SENZA SALVATAGGIO</button>\n\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t}(),Nt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.lbl="",this.nota="",this.nota_commento="",this.title="ASSEGNA DOCUMENTO",this.comm_notrequired=!0,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.arrAutori=this.m_appService.getState().wkf_doc_info.arrAutori;for(var o=0;o<this.arrAutori.length;o++)null==this.arrAutori[o].username&&(this.arrAutori[o].username=this.arrAutori[o].idp);this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)")}return t.prototype.ok=function(){if(this.comm_notrequired||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n<div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false" ></FHPickUsers>\n</div><br><br><br>\n\n <textarea matInput placeholder="Commento {{nota_commento}}" [(ngModel)]="nota" rows="6"></textarea>\n\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Dt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.utenti="",this.lbl="",this.nota="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=!0,this.mobile=!1,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.utenti=this.m_appService.getState().wkf_doc_info.utenti,console.log("this.comm_notrequired"),console.log(this.comm_notrequired),this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("abort")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>\n <div style="font-size:10px" *ngIf="mobile">{{lbl}}</div>\n <div *ngIf="!mobile">{{lbl}}</div>\n\n\n </mat-toolbar>\n <br>\n<div mat-dialog-content style="min-width:800px">\n<div *ngIf="mobile" style="font-size:10px">Assegnata a: {{utenti}}</div>\n <h3 *ngIf="!mobile">Assegnata a: {{utenti}}</h3>\n <br>\n <mat-form-field>\n <textarea matInput placeholder="Commento {{nota_commento}}" [(ngModel)]="nota" rows="6"></textarea>\n</mat-form-field>\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t}(),kt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar>SELEZIONA AMBITO<div style="width:100%;text-align: right;">\n\n\n </div>\n\n </mat-toolbar>\n<div mat-dialog-content><br><br>\n <mat-select placeholder="Seleziona Ambito:" #cmb [(ngModel)]="selval" style="width:100%">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app}}" *ngFor="let app of myData">{{app}}</mat-option>\n </mat-select>\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">OK</button>\n</div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Tt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",console.log("this.setStepCombo"),this.setStepCombo(this.m_appService.getState().wkf_doc_info.livs,this.m_appService.getState().wkf_doc_info.st,this.m_appService.getState().wkf_doc_info.cl)}return t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t,e,i){for(var n=e.split("|"),o=new Array,s=0;s<n.length;s++)for(var r=0;r<t.length;r++){if("*N"==n[s].toString().toUpperCase()){(a={descri_livello:"Prosegui a step successivo"}).g=0==s?1:0,a.livello="*N",o.push(a);break}if("*C"==n[s].toString().toUpperCase()){var a;(a={descri_livello:"Prosegui a chiusura"}).g=0==s?1:0,a.livello="*C",o.push(a);break}if(n[s]==t[r].livello&&n[s]!=i.livello){t[r].g=0==s?1:0,o.push(t[r]);break}}1==o.length&&this.dialogRef.close(o[0].livello),this.myData=o},t.prototype.ok=function(){null!=this.selval&&"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE LO STEP SUCCESSIVO",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar style="max-width:500px">SELEZIONA PROSSIMO STEP:\n\n </mat-toolbar>\n<mat-dialog-content style="max-width:500px"><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Prossimo Step:" #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n\n\n\n<br><br><br><br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">{{OK_BUTTON}}</button>\n <button mat-raised-button (click)="this.dialogRef.close()">ANNULLA</button>\n</div><br><br>\n</mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Mt=function(){function t(t,e,i,n,o,s){var r=this;this.dialogRef=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.uti_s=s,this.enabled=!0,this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.b_False=!1,this.title="ALLEGATI",this.b_ini=!1,this.single=!0,this.label_b="",this.descrizione="",this.file_name="",this.label="Descrizione Allegato",this.username="",this.uploader=new d.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT}),this.username=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(r.descrizione="",r.toastr.info("INFO","ALLEGATO INSERITO",{timeOut:1e3,progressBar:!0}),r.ref_allegato(),r.change.emit())}}return t.prototype.download_all=function(t){console.log(t),null!=t.App&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename),null!=t.APP&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.APP+"/"+t.K+"/"+t.Filename)},t.prototype["delete"]=function(i){var n=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(q).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="DELETE_ALLEGATO",e.types=["int"],e.values=[i.id],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.arr_g=t.result_data,n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))},function(t){})}})},t.prototype.ch=function(){var i=this;this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",""),e.append("local_path",i.app_s.LOCAL_PATH)};var t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],this.uploader.setOptions(t),this.uploader.uploadAll()},t.prototype.ref_allegato=function(){var e=this;if(null!=this.App&&""!=this.App){var t=new D;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.arr_g=t.result_data)},function(t){})}},t.prototype.ngOnInit=function(){this.App=this.app_s.getState().wkf_doc_info.uiid_app,this.K=this.app_s.getState().wkf_doc_info.uiid_doc,this.single=!1,this.init(this.App,this.K),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ref_allegato()},t.decorators=[{type:l.Component,args:[{selector:"wkf_win_upload",template:' <mat-toolbar color="primary">{{title}} <div style="width:100%;text-align: right;">\n </div>\n\n </mat-toolbar>\n <div mat-dialog-content style="min-width:800px">\n <br>\n <div *ngIf="enabled">\n\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}}">\n\n\n <input type="file" ng2FileSelect [uploader]="uploader" multiple (change)="ch()" />\n \x3c!--<button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>--\x3e\n </div>\n <br>\n\n\n\n\n <br>\n <section class="bs">\n <table class="table table-hover table-bordered table-striped table-card">\n <thead>\n <tr>\n <th style="width:25%;">Nome</th>\n <th style="width:15%;">Dim.</th>\n <th style="width:35%;">Descrizione</th>\n <th style="width:15%;">Data</th>\n <th style="width:15%;"></th>\n <th n *ngIf="enabled" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of arr_g">\n <td>{{app.Filename}}</td>\n <td>{{app.Filesize}}</td>\n <td>{{app.descrizione}}</td>\n <td>{{app.dt_ins | date: \'dd/MM/yyyy hh:mm:ss\'}}</td>\n <td> <button (click)="download_all(app)" mat-raised-button >DOWNLOAD</button></td>\n <td><a mat-icon-button *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n </tr>\n </table>\n </section>\n\n\n</div>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'Option 1\')">CHIUDI</button>\n</div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:Y},{type:c.ToastrService},{type:o.MatDialog},{type:R},{type:P}]},t.propDecorators={enabled:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}],single:[{type:l.Input}]},t}(),xt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.user_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close(null)},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n<div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false" ></FHPickUsers>\n</div><br>\n\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Pt=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),Lt=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,console.log(t),this.nota=t.commento,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var n=this,t=new D;t.sql="SELECT_COMMENTI_DOCUMENTO",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){n.commenti_list=t.result_data;for(var i=0;i<n.commenti_list.length;i++)n.commenti_list[i].v_commento="<b>"+n.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";e=!0}e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var n=this,t=new D;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(xt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){var c=this;void 0===p&&(p=!0);var u=new D;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(u).subscribe(function(t){},function(t){c.toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new D).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new D).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngOnInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n <button color="primary" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>INSERISCI\n</button>\n\n </mat-toolbar>\n <br>\n<div mat-dialog-content style="min-width:800px">\n\n <textarea matInput placeholder="Commento" *ngIf="b_edit" [(ngModel)]="nota" rows="12"></textarea>\n\n <div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table class="table table-hover table-bordered table-striped table-card">\n <tr>\n <th>Commento</th>\n <th>Autore</th>\n <th>Data</th>\n <th></th>\n </tr>\n <tbody>\n <ng-template ngFor let-app [ngForOf]="commenti_list" let-i="index">\n <tr>\n\n <td [innerHTML]="app.v_commento"></td>\n <td>{{app.COGNOME+\' \'+app.NOME}}</td>\n <td>{{app.v_data_creazione}}</td>\n <td><mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user" (click)="edit_comm(app)">edit</mat-icon></td>\n </tr>\n </ng-template>\n </tbody>\n </table>\n </section>\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:o.MatDialog},{type:R},{type:c.ToastrService},{type:Y},{type:Pt}]},t}(),Ft=function(){function t(t,e){this.dialogRef=t,this.m_appService=e,this.hide_richiedente=!1,this.codice=this.m_appService.getState().wkf_doc_info.codice,this.data_richiesta=this.m_appService.getState().wkf_doc_info.data_richiesta,this.richiedente=this.m_appService.getState().wkf_doc_info.richiedente,this.stato=this.m_appService.getState().wkf_doc_info.stato,this.in_carico_a=this.m_appService.getState().wkf_doc_info.in_carico_a,this.uiid_app=this.m_appService.getState().wkf_doc_info.uiid_app,this.uiid_doc=this.m_appService.getState().wkf_doc_info.uiid_doc}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar color="primary">INFO DOCUMENTO <div style="width:100%;text-align: right;">\n\n\n </div>\n\n\n </mat-toolbar>\n<div mat-dialog-content>\n <section class="bs">\n <table class="table">\n\n <tbody>\n <tr>\n\n <td>Codice:</td>\n <td><b>{{codice}}</b></td>\n </tr>\n <tr>\n\n <td>Data:</td>\n <td><b>{{data_richiesta | date: \'dd/MM/yyyy hh:mm:ss\'}}</b></td>\n </tr>\n <tr *ngIf="!hide_richiedente">\n\n <td>Richiedente:</td>\n <td><b>{{richiedente}}</b></td>\n\n </tr>\n <tr>\n\n <td>Stato:</td>\n <td><b>{{stato}}</b></td>\n\n </tr>\n <tr>\n\n <td>In Carico a:</td>\n <td><b>{{in_carico_a}}</b></td>\n\n </tr>\n\n <tr>\n\n <td>Uiid App:</td>\n <td><b>{{uiid_app}}</b></td>\n\n </tr>\n <tr>\n\n <td>Uiid Doc:</td>\n <td><b>{{uiid_doc}}</b></td>\n\n </tr>\n </tbody>\n </table>\n </section>\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R}]},t}(),jt=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.logs=new Array,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.not_int=!0,this.subject="",this.link="",this.codice_doc=""}return t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="LOG WORKFLOW E COMMENTI"},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.prototype.ngOnInit=function(){this.refresh_list()},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,console.log(t),this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var i=this,t=new D;t.sql="SELECT_WORKFLOW_LOG",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.logs=t.result_data,e=!0),e||i.toastr.error("ERRORE",t.msg)},function(t){i.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var n=this,t=new D;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(xt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){var c=this;void 0===p&&(p=!0);var u=new D;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(u).subscribe(function(t){},function(t){c.toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new D).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new D).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar color="primary">{{title}}<div style="width:100%;text-align: right;">\n\n</div>\n<button color="primary" (click)="ins()" *ngIf="!b_edit">\n<mat-icon>note_add</mat-icon>INSERISCI\n</button>\n\n</mat-toolbar>\n\n<div mat-dialog-content>\n<section class="bs" *ngIf="b_edit">\n<br><br>\n<textarea matInput placeholder="Commento" *ngIf="b_edit" [(ngModel)]="nota" style="min-width:400px" rows="12"></textarea>\n\n<div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n</div>\n<br><br>\n</section>\n<section class="bs" *ngIf="!b_edit">\n<table class="table">\n\n<tbody>\n <tr>\n <th>Data</th>\n <th>Utente</th>\n <th>Operazione</th>\n <th>Stato Attuale</th>\n <td></td>\n </tr>\n <tbody>\n <ng-template ngFor let-app [ngForOf]="logs" let-i="index">\n<tr>\n<td>{{app.v_data_creazione}}</td>\n<td>{{app.nc}}</td>\n<td>{{app.operazione}}</td>\n<td>{{app.stato_attuale}}</td>\n<td><mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user" (click)="edit_comm(app)">edit</mat-icon></td>\n</tr>\n </ng-template>\n</tbody>\n</table>\n</section>\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;" *ngIf="!b_edit">\n<button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:o.MatDialog},{type:R},{type:c.ToastrService},{type:Y},{type:Pt}]},t}(),zt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.edit=function(t){var e=this,i=new D;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info("Documento "+e.datagrid.sRow.codice+" Recuperato"),e.dialogRef.close("ok"))},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:"Codice",field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Oggetto",field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Stato",field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Richiedente",field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n<div mat-dialog-content style="min-width:800px">\n<FHGrid [filters]="flt_grid" init_fill="false" show_buttons="false" vis #dtm (dclicked)="edit($event)" g_width="100%" g_height="100%" tbl_name="wkf_documents" grid_key="r_wkf_documents" sort_field="codice desc" off_set="50" fields="*"></FHGrid>\n\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={datagrid:[{type:l.ViewChild,args:["dtm"]}]},t}(),Ut=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].livello+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})}else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar>{{title}}\n\n </mat-toolbar>\n<mat-dialog-content><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Step:" #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n\n\n\n<br><br><br><br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()">{{OK_BUTTON}}</button> \n <button mat-raised-button color="warn" (click)="this.dialogRef.close()">ANNULLA</button>\n</div><br><br>\n</mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Yt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n<div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false" [single_sel]="commento_hidden" ></FHPickUsers>\n</div><br><br><br>\n\n <textarea matInput placeholder="Commento {{nota_commento}}" [hidden]="commento_hidden" [(ngModel)]="nota" rows="6"></textarea>\n\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button>\n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Kt=function(){function t(t,e,i,n,o,s,r){this._dataService=t,this.http=e,this.router=i,this.route=n,this._fileService=o,this.app_s=s,this.uti_s=r,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new a.Headers,this.headers.append("Content-Type","application/json")}return t.prototype.logout=function(){localStorage.removeItem(this.app_s.COMPANY_KEY+"user"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_idp"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_password"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_roles"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_lang"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_isadmin"),localStorage.removeItem(this.app_s.COMPANY_KEY+"token"),1!=this.app_s.LOGIN_EXT?this.router.navigate(["login"]):window.location.href=this.app_s.LOGOUT_URL_EXT},t.prototype.login=function(t,e){this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var i=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(i=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,i,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.get_user_info=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var e=JSON.stringify({username_info:t});return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.login_sa=function(){var n=this;if(console.log("login"),!this.checkCredentials()){for(var t=window.location.href.split(/[\&?]+/),e=!1,i=0;i<t.length;i++)if("u="==t[i].substring(0,2)){var o=t[i].split("=")[1];this.username=this.uti_s.decrypt(decodeURI(o)),e=!0}else t[i];if(e)this.get_user_info(this.username).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;n.username="NA",0<i.length?(n.username=i[0].username,console.log("scrivo username: "+i[0].username),console.log(i[0]),localStorage.setItem(n.app_s.COMPANY_KEY+"user_name",i[0].name),localStorage.setItem(n.app_s.COMPANY_KEY+"user_surname",i[0].surname),localStorage.setItem(n.app_s.COMPANY_KEY+"user",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_email",i[0].email),localStorage.setItem(n.app_s.COMPANY_KEY+"user_password",""),localStorage.setItem(n.app_s.COMPANY_KEY+"user_idp",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_lang","IT"),localStorage.setItem(n.app_s.COMPANY_KEY+"user_isadmin",i[0].isadmin),localStorage.setItem(n.app_s.COMPANY_KEY+"user_roles",i[0].roles),localStorage.setItem(n.app_s.COMPANY_KEY+"token","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJlZm9ybmkiLCJpc3MiOiJ3d3cuZmx1eGh1Yi5jb20iLCJyb2xlIjoib2tfbG9nZ2VkIiwiaWF0IjoxNTA3OTA3MzQ2fQ.xqXZsPTu8stomoIl8_2d9DhLkGU3gAi7MXwClYNkEzg"),e=!0):localStorage.removeItem("token")}e||console.log(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")});else{console.log("login");var s=encodeURI(window.location.href).replace("#","%23");-1==s.indexOf("?")&&(s+="?"),this.url="http://csaportale.ceramicasantagostino.it/homepage_new.nsf/OK?OpenForm&redirect="+s,console.log(this.url),window.location.href=this.url}}},t.prototype.passrecovery=function(t){var e=JSON.stringify({email:t,websiteroot:this.app_s.COMPANY_SITE_ROOT,op:"send_email"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.checktoken=function(t){var e=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.change_password=function(t,e){var i=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,i,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return i.Observable["throw"](e)},t.prototype.checkCredentials_toLogin=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")||(1==this.app_s.LOGIN_EXT?this.login_sa():-1==this.router.url.indexOf("/rp/")&&this.router.navigate(["login"]),!1)},t.prototype.checkCredentials=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:Y},{type:a.Http},{type:f.Router},{type:f.ActivatedRoute},{type:C},{type:R},{type:P}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(Y),l.inject(a.Http),l.inject(f.Router),l.inject(f.ActivatedRoute),l.inject(C),l.inject(R),l.inject(P))},token:t,providedIn:"root"}),t}(),Vt=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),qt=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[R,Y,A,C,w,Pt,Q,Kt,P]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:l.NgModule,args:[{imports:[E.MyDatePickerModule,d.FileUploadModule,S.AgGridModule.withComponents([L,F]),I.CommonModule,u.FormsModule,M,O.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),v.FlexLayoutModule,y.MarkdownModule,b.CKEditorModule],declarations:[j,z,U,K,V,B,G,$,X,q,tt,et,F,L,it,nt,st,ot,rt,W,at,lt,pt,ct,ut,ht,J,dt,_t,gt,mt,ft,yt,It,St,Ot,Rt,H,Ct,T,Vt,Z,k,D,N,At,Nt,Dt,kt,Tt,Mt,Lt,Ft,jt,zt,Ut,Yt,xt],exports:[j,z,U,K,V,B,G,$,X,q,tt,et,F,L,it,nt,st,ot,rt,W,at,lt,pt,ct,ut,ht,J,dt,_t,gt,mt,ft,yt,It,St,Ot,Rt,H,Ct,T,Vt,Z,k,D,N],providers:[],entryComponents:[At,Nt,Dt,kt,Tt,Mt,Lt,Ft,jt,zt,Ut,Yt,xt,dt,q,z,it,nt,rt,W,at,lt,ct,J,_t,ft,St,Rt,H]}]}],t}(),Bt=function(){function t(t,e,i,n,o,s,r,a){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.appService=s,this.slimLoadingBarService=r,this.app_s=a,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.routingDestination="",this.arr_accessi=null}return t.prototype.canActivate=function(t,e){var n=this;return this.routingDestination=t.url[0].path,console.log(this.routingDestination),""==this.routingDestination||("login"==this.routingDestination||"rp"==this.routingDestination||"pr"==this.routingDestination||"/"==this.routingDestination||(this.auth.checkCredentials()?"home"==this.routingDestination||(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")&&"1"==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||new Promise(function(i){if(null!=n.arr_accessi){for(var t=0;t<n.arr_accessi.length;t++)if("M"==n.arr_accessi[t].type&&"["+n.arr_accessi[t].url.split("/").join("")+"]"=="["+n.routingDestination.split("/").join("")+"]")return console.log(typeof r.Observable.of(!0)),console.log("OBS3 "+!0),void i(!0);return n.toast.error("ACCESS DENIED"),n.slimLoadingBarService.complete(),void i(!1)}var e=new D;e.sql="SELECT_APPS_USER",n.appService.getState().app_enabled=new Array,e.types=["string"],e.values=[localStorage.getItem(n.app_s.COMPANY_KEY+"user")],n.querys.doQuery(e).subscribe(function(t){n.arr_accessi=t.result_data;for(var e=0;e<n.arr_accessi.length;e++)if("M"==n.arr_accessi[e].type&&"["+n.arr_accessi[e].url.split("/").join("")+"]"=="["+n.routingDestination.split("/").join("")+"]")return console.log(typeof r.Observable.of(!0)),console.log("OBS3 "+!0),void i(!0);n.toast.error("ACCESS DENIED"),i(!1),n.slimLoadingBarService.complete()})})):(this.toast.error("ACCESS DENIED"),this.slimLoadingBarService.complete(),!1)))},t.decorators=[{type:l.Injectable}],t.ctorParameters=function(){return[{type:a.Http},{type:Kt},{type:f.Router},{type:c.ToastrService},{type:Y},{type:R},{type:_.SlimLoadingBarService},{type:R}]},t}(),Ht=function Jt(t,e,i){this.year=t,this.month=e,this.day=i},Gt=function(){function t(t){this.app_s=t}return t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(undefined);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),0<(t||"").toString().indexOf(",")&&(t=(t||"").toString().split(".").join("").split(",").join("."));var s=x((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=0<e?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e){if(10!=t.length)return null;var i=t.split("-");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]))}if(2==e&&19<=t.length){i=(o=(t=t.substring(0,19)).split("T"))[0].split("-");var n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}if(3==e&&16<=t.length){var o;i=(o=(t=t.substring(0,16)).split(" "))[0].split("/"),n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),0)}return null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.DateAdd=function(t,e,i){var n,o=i.valueOf();switch(t){case"ms":n=new Date(o+1*e);break;case"s":n=new Date(o+1e3*e);break;case"mi":n=new Date(o+6e4*e);break;case"h":n=new Date(o+36e5*e);break;case"d":n=new Date(o+864e5*e);break;case"y":n=new Date(o+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()," ",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i,"T",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,r,a,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",r=void 0===n?",":n,(t<0?"-":"")+((l=3<(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)?l%3:0)?a.substr(0,l)+r:"")+a.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+r)+(o?s+Math.abs(t-a).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles")&&(!(!e||null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin"))||-1<localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles").toUpperCase().indexOf(t.toLocaleUpperCase()))},t}(),Qt=function(){function t(t,e,i,n,o,s,r,a){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_fservice=n,this.m_router=o,this._toastr=s,this.dialog=r,this.m_wkf=a,this.b_editing=!1,this.is_Supervisor=!1,this.is_Admin=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.imp="",this.sort_field="",e.checkCredentials()&&(this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc")}return t.prototype.goto_edit_doc=function(t,e){console.log("App"+this.app_root+" a "+t+" d "+e),this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.annulla_richiesta=function(){var i=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi di voler annullare il documento numero: "+this.get_grid().sRow.codice+"?"),this.dialog.open(q,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="UPDATE_WKF_ANNULATO",e.types=["string","string","int"],e.values=[i.id_applicativo,i.get_grid().sRow.uiid,-1],i.m_dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}})):this._toastr.error("Selezionare il documento da annullare")},t.prototype.recupera_richiesta=function(){var e=this,t=this.dialog.open(zt,{disableClose:!0});t.componentInstance.init_w(this.id_applicativo),t.afterClosed().subscribe(function(t){"ok"==t&&e.get_grid().doFill("")})},t.prototype.riassegna_richiesta=function(){var s=this;if(null!=this.get_grid().sRow){var t=new D;t.sql="SELECT_WLIVELLIV2ADM",t.types=["string","string","string"],t.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato],this.m_dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){s.livs_adm=t.result_data;for(var e=new Array,i="",n=0;n<s.livs_adm.length;n++)-1==i.indexOf(String(s.livs_adm[n].livello))&&(i=i+String(s.livs_adm[n].livello)+"|",e.push(s.livs_adm[n]));var o=s.dialog.open(Ut,{disableClose:!0});o.componentInstance.setStepCombo(e),o.componentInstance.title="Riassegnazione documento: "+s.get_grid().sRow.codice+" - "+s.get_grid().sRow.oggetto,o.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(console.log(t),s.os_r=t.lvl_sel,s.riassegna_richiesta_step1())})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var e=this,t=new Array,i=0;i<this.livs_adm.length;i++)this.livs_adm[i].livello==this.os_r.livello&&0==this.livs_adm[i].notifica&&t.push(this.livs_adm[i]);var n=this.dialog.open(Yt,{disableClose:!0});for(i=0;i<t.length;i++)t[i].nc=t[i].nc.split(" ()").join(""),null!=t[i].idp&&null==t[i].username&&(t[i].username=t[i].idp);console.log(t),n.componentInstance.arrAutori=t,n.componentInstance.title="Riassegnazione documento: "+this.get_grid().sRow.codice+" - "+this.get_grid().sRow.oggetto,n.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(e.wax=t.arrsel,e.nota_wax=t.nota,e.riassegna_richiesta_step2())})},t.prototype.riassegna_richiesta_step2=function(){var e=this,t="";null!=this.get_grid().sRow.lettori&&(t=this.get_grid().sRow.lettori);var i,n="",o="",s="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);for(var a="",l=0;l<this.wax.length;l++)""!=a&&(a+=","),a+=this.wax[l].idp,-1==t.indexOf(this.wax[l].idp)&&(""!=t&&(t+=","),t+=this.wax[l].idp),-1==o.indexOf(this.wax[l].nc)&&(""!=o&&(o+=","),o+=this.wax[l].nc),""!=s&&(s+=","),s+=this.wax[l].nc,null!=r&&-1==r.indexOf(this.wax[l].idp)&&(""!=r&&(r+=","),r+=this.wax[l].idp),""!=n&&(n+=","),n+=this.wax[l].idp;(this.sendEMail_ex(this.user_idp,a,this.titolo_email+"L'utente "+this.user_cognome+" "+this.user_nome+" ti ha riassegnato il documento: "+this.get_grid().sRow.codice,"Commento:\n\n"+this.nota_wax,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax),(i=new D).sql="INSERT_COMMENTO_RIASS",i.types=["string","string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+s,this.user_idp,this.os_r.descri_livello],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new D).sql="UPDATE_RIASS_DOCUMENTO",i.types=["string","string","string","string","string","string","string","string","string"],i.values=[this.os_r.livello,this.os_r.descri_livello,t,n,this.os_r.descri_livello,o,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&e.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new D).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),0<this.wax.length)&&((i=new D).sql="UPDATE_RIASSEGNA_TODO",i.types=["string","string"],i.values=[this.wax[0].idp,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l){var p=this,c=new D;c.sql="send_wkf_mail",c.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(c).subscribe(function(t){},function(t){p._toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.annulla_imp=function(){localStorage.setItem(this.app_s.COMPANY_KEY+"user_name",localStorage.getItem(this.app_s.COMPANY_KEY+"user_name_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user",localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_surname",localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_email",localStorage.getItem(this.app_s.COMPANY_KEY+"user_email_ori")),this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email_ori"),this.imp="",this.get_grid().doFill("")},t.prototype.test_utente=function(){var i=this,n=new D;n.sql="SELECT_UTENTI_WORKFLOW",n.types=["string"],n.values=[this.id_applicativo],this.m_dataService.doQuery(n).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){console.log(t.result_data);var e=i.dialog.open(Yt,{disableClose:!0});e.componentInstance.arrAutori=t.result_data,e.componentInstance.title="Impersona Utente",e.componentInstance.commento_hidden=!0,e.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&((n=new D).sql="SELECT_USER_INFO_WKF",n.types=["string"],n.values=[t.arrsel[0].username],i.m_dataService.doQuery(n).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(localStorage.setItem(i.app_s.COMPANY_KEY+"user_name_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_name")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_surname")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_email")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_name",t.result_data[0].nome),localStorage.setItem(i.app_s.COMPANY_KEY+"user",t.result_data[0].username),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname",t.result_data[0].cognome),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email",t.result_data[0].email),i.user_idp=t.result_data[0].username,i.user_nome=t.result_data[0].nome,i.user_cognome=t.result_data[0].cognome,i.user_email=t.result_data[0].email,i.imp="ANNULLA IMP: "+t.result_data[0].cognome+" "+t.result_data[0].nome,i.get_grid().doFill(""))}))})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj=new Object,this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.app_s.getState().wkf_obj.title,this.init_end(),this.app_s.getState().topnavTitle=this.att_panelcat},t.prototype.init_Panel=function(t,n){var o=this;if(null==this.app_s.getState().wkf_obj||this.app_s.getState().wkf_obj.codice_app!=t){null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")&&(this.imp="ANNULLA IMP: "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname")+" "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"));var e=new D;e.sql="SELECT_WKF_APP_INFO",e.types=["string"];var s=!(e.values=[t]);this.m_dataService.doQuery(e).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;s=!0,o.m_id_Doc=n,o.id_applicativo=e[0].id_gruppo,o.app_root=e[0].modulo_swf,o.codice_app=e[0].codice_documento,o.att_panelcat=e[0].descrizione_breve,o.documento_pubblico=e[0].pubblico,o.titolo_email="["+e[0].descrizione_breve+"]",o.tbl_name=e[0].vista_sql,o.grid_key=o.app_s.COMPANY_KEY+e[0].vista_sql,o.user_idp=localStorage.getItem(o.app_s.COMPANY_KEY+"user"),o.user_nome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_name"),o.user_cognome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_surname"),o.user_email=localStorage.getItem(o.app_s.COMPANY_KEY+"user_email"),o.app_s.getState().topnavTitle=o.att_panelcat;var i=new D;i.sql="SELECT_UTENTE_WKF_ADMIN",i.types=["string","string"],i.values=[o.id_applicativo,localStorage.getItem(o.app_s.COMPANY_KEY+"user")],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;o.is_Supervisor=!1,o.is_Admin=!1,0<e.length&&(o.is_Supervisor=!0,"1"==e[0].tipo&&(o.is_Admin=!0)),s=!0;var i=new D;i.sql="SELECT_WLIVELLIV2",i.types=["string","string"],i.values=[o.id_applicativo,""],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(o.init_end(),o.ok_conf_s(t.result_data),s=!0),s||console.error(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),s=!0}s||console.error(t.msg)},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this.restore_state_wkf()},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if((this.livs[e].idp.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].gruppo_parallelo)&&10==this.livs[e].livello&&0==this.livs[e].notifica){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.insert_doc=function(){this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t}(),Wt=function(){function t(t,e,i,n,o,s,r,a){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this.m_dialog=o,this.m_route=s,this.m_wkf=r,this.uti_s=a,this.m_obj=new Object,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.oper="",this.forza_canale="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.opx="",this.tn_selectedIndex=0,this.default_tab=1,this.b_annulla=!1,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1,this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email"),console.log("user_idp: "+this.user_idp)}return t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info=new Object,this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento},t.prototype.evt_salv=function(){this.btnprocedi=!1,this.salva()},t.prototype.salva=function(){if(""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].livello,console.log("-----------"),console.log(this.livs[e]));else{if(t=this.m_obj.stato,null!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo){this.clevel=this.livs[e];break}if(null==this.clevel)for(e=0;e<this.livs.length;e++)if(console.log(this.livs[e]),this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||(console.log(this.c_canale+" "+this.livs[e].gruppo_parallelo),0!=this.livs[e].notifica||""!=this.c_canale&&""!=this.livs[e].gruppo_parallelo&&this.c_canale!=this.livs[e].gruppo_parallelo&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo))){this.clevel=this.livs[e];break}}if(this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].livello>t&&0!=t&&this.livs[e].livello!=i&&(-1==this.limite_salto_after||this.livs[e].livello<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].livello);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].gruppo_parallelo||this.c_canale==this.livs[o].gruppo_parallelo)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}if("procedi"==this.oper){if(console.log("this.oper "+this.clevel.livelli_jump),null==this.clevel.livelli_jump&&(this.clevel.livelli_jump=""),""!=this.clevel.livelli_jump)return console.log("selectLevel "+this.clevel.livelli_jump),void this.selectLevel(this.clevel.livelli_jump);this.calcolanextandjump()}if("respingi"==this.oper){if(null==this.clevel.livelli_down&&(this.clevel.livelli_down=""),""!=this.clevel.livelli_down)return void this.selectLevel(this.clevel.livelli_down);this.alert("Errore di configurazione pratica contattare ufficio IT [0x004]",1)}}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.selectLevel=function(t){var o=this;this.app_s.getState().wkf_doc_info.livs=this.livs,this.app_s.getState().wkf_doc_info.st=t,this.app_s.getState().wkf_doc_info.cl=this.clevel,this.m_dialog.open(Tt,{disableClose:!0}).afterClosed().subscribe(function(t){if(null!=t){var e=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){e=o.wkf_rule(e);var i=!1;for(n=0;n<o.livs.length;n++)o.user_idp.toUpperCase()==o.livs[n].idp.toUpperCase()&&0==o.livs[n].notifica&&o.livs[n].livello==e&&(o.nlevel=o.livs[n],e=o.livs[n].livello,i=!0);if(!i)for(n=0;n<o.livs.length;n++)if(o.livs[n].livello==e&&0==o.livs[n].notifica){o.nlevel=o.livs[n],e=o.livs[n].livello;break}o.doJump()}else{for(var n=e=0;n<o.livs.length;n++)o.livs[n].livello<900&&o.livs[n].livello>e&&0==o.livs[n].notifica&&(o.clevel=o.livs[n],e=o.livs[n].livello);o.calcolanextandjump()}else o.calcolanextandjump()}else o.edit_b(!0)})},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello,console.log("liv: "+t);for(var i=0;i<this.livs.length;i++)(0==t||t<this.livs[i].livello&&e>this.livs[i].livello)&&(this.nlevel=this.livs[i],e=this.livs[i].livello);t=this.wkf_rule(e);var n=!1;for(i=0;i<this.livs.length;i++)0!=this.livs[i].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo||this.livs[i].livello==t&&(this.nlevel=this.livs[i],t=this.livs[i].livello,n=!0);if(!n)for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==t&&0==this.livs[i].notifica){this.nlevel=this.livs[i],t=this.livs[i].livello;break}var o=t,s=this.nlevel;if(2==this.nlevel.salto_iniziale){for(i=0;i<this.livs.length;i++)s.idp.toUpperCase()==this.livs[i].idp.toUpperCase()&&0==this.livs[i].notifica&&s.gruppo_parallelo==this.livs[i].gruppo_parallelo&&this.livs[i].livello>o&&0!=o&&(this.nlevel=this.livs[i],t=this.livs[i].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var e=this;this.user_idp.toUpperCase();if(null!=this.nlevel){var i=new Array;if(""==this.clevel.gruppo_parallelo)for(var t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&i.push(this.livs[t]);else{var n=!1;for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&""!=this.livs[t].gruppo_parallelo&&(n=!0);console.log("canale: "+this.clevel.gruppo_parallelo);for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&(console.log("canale: "+this.clevel.gruppo_parallelo+" "+this.livs[t].gruppo_parallelo),this.clevel.gruppo_parallelo!=this.livs[t].gruppo_parallelo&&n||(i.push(this.livs[t]),this.nlevel=this.livs[t]))}if(0!=i.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title="Avanzamento";for(var o="",s=0;s<i.length;s++)""!=o&&(o+=";"),o+=i[s].nc;this.app_s.getState().wkf_doc_info.utenti="",this.nlevel.livello<900?this.app_s.getState().wkf_doc_info.lbl="Il documento verrà inviato a "+this.nlevel.descri_livello:this.app_s.getState().wkf_doc_info.lbl="La richiesta verrà chiusa con stato: "+this.nlevel.descri_livello,this.app_s.getState().wkf_doc_info.utenti=o,1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.m_dialog.open(Dt,{disableClose:!0}).afterClosed().subscribe(function(t){if("abort"==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=i,e.nota=t,e.OKCOM()})}else{this.app_s.getState().wkf_doc_info.title="Assegnazione",1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.app_s.getState().wkf_doc_info.arrAutori=i.sort(function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}),this.m_dialog.open(Nt,{disableClose:!0}).afterClosed().subscribe(function(t){if(""==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=t.arrsel,e.nota=t.nota,e.OKCOM()})}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)}else this.alert("problema di configurazione passaggio avanti dal livello "+this.clevel.descri_livello+" non attivato comunicare al CED",1)},t.prototype.OKCOM=function(){var i=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),this.m_danotificare="";for(var t,e=this.m_autori="",n=0;n<this.arrUsersSelected.length;n++)""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[n].idp,-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[n].idp),console.log("m_lettori2 "+this.m_lettori),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[n].idp,e+=this.arrUsersSelected[n].nc),console.log("m_lettori3 "+this.m_lettori);""!=this.nota&&this.insert_commento(this.id_applicativo,this.id_documento,this.nota,this.user_idp),this.m_liv=this.nlevel.livello,this.m_statox="Assegnata a:"+e,this.m_autori_paralleli="",this.m_obj.assegnati_paralleli="",this.chstato(this.m_liv),this.m_obj.stato<=10&&this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp);for(n=0;n<this.livs.length;n++)this.livs[n].livello==this.m_liv&&1==this.livs[n].notifica&&(1==this.livs[n].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[n].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[n].idp));if(900<=this.nlevel.livello){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello),(r=new D).sql="UPDATE_DATA_CHIUSURA",r.values=[this.id_applicativo,this.id_documento],r.types=["string","string"],this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})}t=this.app_info.documento_pubblico?new Array(this.m_autori,"",this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento):new Array(this.m_autori,this.m_lettori,this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento);for(var o=new Array,s=0;s<t.length;s++)o.push("string");if(this.m_crea_att=1,900<=this.m_liv&&(this.m_crea_att=0),this.b_respingi&&(this.m_oper="Respinta"),null!=this.clevel&&null!=this.clevel.descri_livello&&(this.m_oper=this.m_oper+" - "+this.clevel.descri_livello),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(this.m_oper=this.m_oper+" -> "+this.nlevel.descri_livello),(r=new D).sql="doWKF",r.values=[this.app_info.descrizione_breve,this.m_obj.codice,this.m_autori,this.m_danotificare,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"La scheda numero: "+this.m_obj.codice+" è passata allo stato: "+this.m_statox,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,this.m_statox,this.m_oper,this.id_applicativo,this.id_documento,""+this.m_crea_att,""+this.m_send_email,""+this.clevel.livello,""+this.nlevel.livello],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.clevel.livello+"_PLAYER",this.user_idp),this.m_wkf.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(r=new D).sql="UPDATE_WKF_DOCUMENTOV3_NS",r.values=t,r.types=o,this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),""!=this.m_danotificare){var r,a="";if(""!=this.nota&&(a="<br>Commento: "+this.nota),1==this.clevel.ccn_mittente&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.user_idp),(r=new D).sql="exec_app_workflow",r.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp],this.m_wkf.doQuery(r).subscribe(function(t){},function(t){}),1==this.nlevel.approvazione_email);else if(1==this.nlevel.email_partecipanti||1==this.nlevel.email_ospiti)if(this.b_respingi)this.sendEMail_ex(this.user_idp,this.m_danotificare,"Respinta "+this.getTitle()+"-["+this.m_obj.codice+"]","<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+"<br>Commenti:"+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota);else if(console.log("--------------this.clevel.oggetto_text----------------------"),console.log(this.nlevel.oggetto_email),null==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota);else if(""==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota);else{var l=this.nlevel.oggetto_email;for(var p in console.log("OGGETTO CUSTOM!"),this.m_obj)null!=this.m_obj[p]&&(console.log(p+" "+Object.prototype.toString.call(this.m_obj[p])),l="[object Date]"===Object.prototype.toString.call(this.m_obj[p])?l.split("%"+p+"%").join(this.uti_s.date2String(this.m_obj[p])):-1==(""+this.m_obj[p]).indexOf("T00:00:00")?l.split("%"+p+"%").join(this.m_obj[p]):l.split("%"+p+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[p],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,l,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota)}else this.goto_edit_doc()}},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){var c=this;void 0===p&&(p=!0);var u=new D;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(u).subscribe(function(t){c.goto_edit_doc(p)},function(t){})},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].livello)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=this,s=new D;s.sql="INSERT_WKF_COMMENTO",s.values=[t,e,i,n],s.types=["string","string","string","string"],this.m_dataService.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=this,s=new D;s.sql="insert_wkf_variabile",s.values=[t,e,i,n],this.m_wkf.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.respingi=function(){if(this.oper="respingi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(){var e=this,t=this.m_dialog.open(jt,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_commenti=function(){var e=this,t=this.m_dialog.open(Lt,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_upload=function(){var e=this;this.m_dialog.open(Mt,{disableClose:!0}).afterClosed().subscribe(function(t){e.r_count()})},t.prototype.create_new_document=function(){var i=this,t=new D;t.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),t.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.save_agg(),e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.save_agg=function(){var i=this;this.edit_b(!1);var t=this.getfieldvalues(),e=new D;e.sql="insert_aggiuntivi",e.types=["string","string"],e.values=[this.app_info.tabella_dati,this.id_documento],e.names=["tabella","id_documento"];for(var n=0;n<t.length;n++)e.types.push(t[n].types),e.names.push(t[n].names),null!=t[n].values?("int"==t[n].types&&e.values.push(""+t[n].values),"string"==t[n].types&&e.values.push(""+t[n].values),"date"==t[n].types&&e.values.push(this.uti_s.sql_date(t[n].values)),"datetime"==t[n].types&&e.values.push(this.uti_s.sql_date_time(t[n].values)),"decimal"==t[n].types&&e.values.push(""+t[n].values)):e.values.push("dbnull"),console.log(e.names[n+2]+" "+e.values[n+2]);this.m_wkf.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_insert_aggiuntivi(),e=!0),e||(i.errorMsg=t.msg)},function(t){})},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.edit_b(!0),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var n=this;console.log("load_document()");var t=new D;t.sql="SELECT_WKF_DOCUMENT_NOREP",t.types=["string","string","string"],t.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;0<i.length?n.ok_load_document(i[0]):n.alert("DOCUMENTO NON TROVATO",1),e=!0}e||(n.errorMsg=t.msg)},function(t){})},t.prototype.ok_load_document=function(t){var i=this;console.log(t),this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1),this.save_to_app_state();var e=new D;e.sql="SELECT_LIVELLI_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_livelli_doc(t.result_data),e=!0),e||(i.errorMsg=t.msg)},function(t){})},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.over_canale_iniz(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].idp.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||10==this.livs[e].livello&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var r=this,t=new D;t.sql="SELECT_WKF_ALLEGATI_COUNTER",t.types=["string","string"],t.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){for(var i=t.result_data,n=0,o=0,s=0;s<i.length;s++)0<i[s].n&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));r.reset_counters(o,n),e=!0}e||(r.errorMsg=t.msg)},function(t){})},t.prototype.set_canale_iniziale=function(t){console.log("Forza canale "+t),this.forza_canale=t},t.prototype.over_canale_iniz=function(){if(""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale,console.log("-------------"+this.forza_canale+"--------------------"),console.log(this.livs[e]));console.log("forza canale exec"+this.forza_canale),this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale),this.c_canale=this.forza_canale}},t.prototype.ck_canale_multiplo=function(){for(var e=this,t=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<t||0==t)&&(this.clevel=this.livs[i],t=this.livs[i].livello);console.log(t),console.log(this.app_s.getState().wkf_doc_info.curr_user.toUpperCase());var n=new Array;for(i=0;i<this.livs.length;i++)this.livs[i].livello==t&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].idp.toUpperCase()&&(null!=this.livs[i].gruppo_parallelo?n.push(this.livs[i].gruppo_parallelo):n.push(""));n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort(function(t,e){return e<t?1:t<e?-1:0}),this.m_dialog.open(kt,{disableClose:!0}).afterClosed().subscribe(function(t){e.c_canale=t,e.create_new_document()}))},t.prototype.open_info=function(){var t=this.m_dialog.open(Ft,{disableClose:!0});t.componentInstance.hide_richiedente=this.hide_richiedente,t.afterClosed().subscribe(function(t){})},t.prototype.setForceJump=function(t,e){var i,n=this;void 0===e&&(e="");for(var o,s="",r="",a="",l=0;l<this.livs.length;l++)t!=this.livs[l].livello||0!=this.livs[l].notifica||""!=e&&!this.livs[l].canale||(""!=s&&(s+=","),s+=this.livs[l].idp,""!=r&&(r+=","),r+=this.livs[l].nc,a=this.livs[l].descri_livello);if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;o=this.app_info.documento_pubblico?new Array(s,"",t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento):new Array(s,this.m_obj.partecipanti+","+s,t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento);var p=new Array;for(l=0;l<o.length;l++)p.push("string");return(i=new D).sql="doWKF",i.values=[this.app_info.descrizione_breve,this.m_obj.codice,""+t,""+t,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"La scheda numero: "+this.m_obj.codice+" è passata allo stato: "+a,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,a,"",this.id_applicativo,this.id_documento,"1","0",""+this.m_obj.stato,""+t],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.m_obj.stato+"_PLAYER",this.user_idp),this.m_wkf.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(i=new D).sql="UPDATE_WKF_DOCUMENTOV3_NS",i.values=o,i.types=p,this.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),this.goto_edit_doc(),"OK"},t.prototype.insert_doc=function(){var i=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.enabled_form(),this.app_s.getState().topnavTitle=this.app_info.descrizione_breve+" - Nuova Richiesta",this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_counters(0,0);var t=new D;t.sql="SELECT_WLIVELLIV2",t.types=["string","string"],t.values=[this.id_applicativo,""],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(console.log(t.result_data),i.ok_livw2(t.result_data),e=!0),e||(i.errorMsg=t.msg)},function(t){}),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&(e=this.livs[i].livello);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(this.user_idp.toUpperCase()==this.livs[i].idp.toUpperCase()||"*ALLUSERS"==this.livs[i].gruppo_parallelo)){1==this.livs[i].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1,this.edit_b(!0);break}},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){console.log("return_edit");for(var t=0;t<this.livs.length;t++)if(this.livs[t].livello==this.m_obj.stato){1==this.livs[t].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}-1!=this.m_obj.autori.toLowerCase().indexOf(this.user_idp.toLowerCase())&&(this.edit_b(!0),this.respingi_enabled&&this.resp_b(!0)),this.r_count();var e=this.m_obj.autori.split(",");for(t=0;t<e.length;t++)for(var i=0;i<this.livs.length;i++)if(this.livs[i].idp==e[t]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[i].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.app_s.getState().topnavTitle=this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato,this.reset_form(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato)},t.prototype.onResize=function(t){},t.prototype.ngOnInit=function(){var n=this;this.m_route.params.subscribe(function(t){n.onResize();var e=t.op;if(n.id_applicativo=t.idapp,n.id_documento=t.id_doc,n.b_edit="new"!=e,n.b_edit||-1<n.id_applicativo.indexOf("_")&&(n.simple_mode=!0,n.id_applicativo=n.id_applicativo.split("_").join("")),n.b_valid=!!n.id_applicativo,n.b_valid){var i=new D;i.sql="SELECT_WKF_APP_INFO_BYUID",i.types=["string"],i.values=[n.id_applicativo],n.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(0<t.result_data.length?(n.setta_info_app(t.result_data[0]),n.b_edit?n.edit_doc():n.insert_doc()):n.alert("CODICE APPLICAZIONE NON VALIDO",2),e=!0),e||n.alert(t.msg,2)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",2)})}else n.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)})},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].livello)return""!=this.livs[i].livello?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].idp.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},t.propDecorators={onResize:[{type:l.HostListener,args:["window:resize",["event"]]}]},t}();t.FluxhubLibModule=qt,t.AppService=R,t.AppMakerService=A,t.FileService=C,t.OdbcService=w,t.QueryService=Y,t.WkfService=Pt,t.GridService=Q,t.AuthenticationService=Kt,t.UtilityService=P,t.FHGuard=Bt,t.FHGridComponent=$,t.ApprovaGridComponent=nt,t.CurrencyComponent=V,t.DateComponent=F,t.DtPick=ht,t.dt=Ht,t.NumericEditorComponent=L,t.ComboBoxEditor=lt,t.TextAreaEditor=at,t.FHAutoCompleteComponent=tt,t.FHComboboxComponent=X,t.FHConfirmComponent=q,t.FHCurrencyFieldComponent=yt,t.FHCurrencyFormatterDirective=st,t.FHCurrencyPipe=ot,t.FHDatePickerComponent=et,t.FHListComponent=pt,t.FHLogPanelComponent=mt,t.FHMdReader=gt,t.FHNumericFieldComponent=Ot,t.ReplaceLineBreaks=ut,t.FHRichText=It,t.FHTimePickerComponent=K,t.FHUploadComponent=G,t.FHUploadPanelComponent=B,t.FHUserFieldComponent=Ct,t.FHUserPickerComponent=it,t.FHPickListComponent=dt,t.FHUtility=Gt,t.WinAskNumberComponent=_t,t.WinAskTextComponent=J,t.WinAskTextBigComponent=ft,t.FHWinComboSelect=ct,t.FHListPick=Rt,t.win_mappa=rt,t.WinOutputComponent=St,t.win_time_slider=z,t.WinWait=H,t.QGParam=Z,t.QGResult=k,t.QParam=D,t.QResult=N,t.FSInput=T,t.FSResult=Vt,t.wkfapp=Qt,t.dati_aggiuntivi=Wt,t.ɵa=vt,t.ɵh=W,t.ɵb=Et,t.ɵc=bt,t.ɵd=wt,t.ɵe=M,t.ɵg=U,t.ɵf=j,t.ɵj=Nt,t.ɵo=Lt,t.ɵu=xt,t.ɵk=Dt,t.ɵp=Ft,t.ɵq=jt,t.ɵr=zt,t.ɵs=Ut,t.ɵt=Yt,t.ɵi=At,t.ɵl=kt,t.ɵm=Tt,t.ɵn=Mt,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs/Observable"),require("rxjs/Rx"),require("@angular/http"),require("rxjs/operators"),require("rxjs"),require("@angular/cdk/table"),require("@angular/material"),require("@angular/platform-browser"),require("ngx-toastr"),require("@angular/forms"),require("@angular/common/http"),require("ng2-file-upload"),require("ng2-slim-loading-bar"),require("ag-grid-enterprise"),require("jquery"),require("@angular/router"),require("@angular/flex-layout"),require("ngx-markdown"),require("ng2-ckeditor"),require("@angular/common"),require("ag-grid-angular"),require("mydatepicker"),require("@agm/core")):"function"==typeof define&&define.amd?define("@fluxhub/fluxhub-lib",["exports","@angular/core","rxjs/Observable","rxjs/Rx","@angular/http","rxjs/operators","rxjs","@angular/cdk/table","@angular/material","@angular/platform-browser","ngx-toastr","@angular/forms","@angular/common/http","ng2-file-upload","ng2-slim-loading-bar","ag-grid-enterprise","jquery","@angular/router","@angular/flex-layout","ngx-markdown","ng2-ckeditor","@angular/common","ag-grid-angular","mydatepicker","@agm/core"],e):e((t.fluxhub=t.fluxhub||{},t.fluxhub["fluxhub-lib"]={}),t.ng.core,t.rxjs.Observable,t.rxjs.Rx,t.ng.http,t.rxjs.operators,t.rxjs,t.ng.cdk.table,t.ng.material,t.ng.platformBrowser,null,t.ng.forms,t.ng.common.http,null,null,null,null,t.ng.router,t.ng["flex-layout"],null,null,t.ng.common,null,null,null)}(this,function(t,l,i,e,a,s,r,n,o,p,c,u,h,d,_,g,m,f,v,y,b,I,S,E,O){"use strict";"default"in m&&m["default"];var R=function(){function t(){this.API_ENDPOINT="http://localhost:9090/api/",this.PORTAL_TITLE="FLUXHUB INTRANET PORTAL",this.COMPANY_KEY="PROLOGIKA_",this.COMPANY_SITE_ROOT="http://localhost:4200/",this.SQL_SERVER_LANG="uk",this.LOCAL_PATH="",this.LOGIN_EXT=0,this.LDAP_AUTH=0,this.CHANGE_PASSWORD=1,this.COLOR_SEARCH="#FFFFFF",this.LOGOUT_URL_EXT="",this.GRID_ENDPOINT="dogrid",this.UPLOAD_ENDPOINT="doupload",this.LOGIN_ENDPOINT="login",this.APPMAKER_ENDPOINT="do_app_maker",this.FILE_ENDPOINT="dofile",this.ODBC_ENDPOINT="doquery_odbc",this.QUERY_ENDPOINT="doquery",this.WKF_ENDPOINT="dowkf",this.PASSRECOVERY_ENDPOINT="passrecovery",this.state={appName:"FLUXHUB V2",darkMode:!1,defaultLang:"en",topnavTitle:"Fluxhub",sidenavOpen:!1,sidenavMode:"side",sidenavCollapse:!0,pageFullscreen:!1,pageFooter:!1,initial:!1,wkf_obj:null,wkf_doc_info:null,grid_obj:null,appo_dialog:null,m_notif:null,style_search_home:this.COLOR_SEARCH,mobile:!1,body_height:"0px",body_height1:"0px",body_height2:"0px"}}return t.prototype.cloneState=function(){return JSON.parse(JSON.stringify(this.state))},t.prototype.reloadState=function(t){this.state=t},t.prototype.getState=function(t){var e=this.state;return e.hasOwnProperty(t)?e[t]:e},t.prototype.setState=function(t,e){return this.state[t]=e},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=l.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),w=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),C=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),A=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type",'"application/x-www-form-urlencoded; charset=utf-8"')}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),r.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).pipe(s.map(function(t){return new Blob([t],{type:"application/octect"})}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),N=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),D=function(){function t(){this.values=new Array,this.types=new Array,this.names=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),k=function(){function t(){}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),T=function(){function t(){this.command="",this.p1="",this.p2=""}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),M=function(){function t(){}return t.decorators=[{type:l.NgModule,args:[{exports:[n.CdkTableModule,o.MatAutocompleteModule,o.MatDialogModule,o.MatButtonModule,o.MatButtonToggleModule,o.MatCardModule,o.MatCheckboxModule,o.MatChipsModule,o.MatDatepickerModule,o.MatDialogModule,o.MatExpansionModule,o.MatFormFieldModule,o.MatGridListModule,o.MatIconModule,o.MatInputModule,o.MatListModule,o.MatMenuModule,o.MatProgressBarModule,o.MatProgressSpinnerModule,o.MatRadioModule,o.MatSelectModule,o.MatSlideToggleModule,o.MatSliderModule,o.MatSidenavModule,o.MatSnackBarModule,o.MatStepperModule,o.MatTabsModule,o.MatToolbarModule,o.MatTooltipModule,o.MatPaginatorModule,o.MatSortModule,o.MatTableModule,o.MatNativeDateModule]}]}],t}();function x(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(i=s["return"])&&i.call(s)}finally{if(o)throw o.error}}return r}var P=function(){function t(t){this.app_s=t}return t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(undefined);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),0<(t||"").toString().indexOf(",")&&(t=(t||"").toString().split(".").join("").split(",").join("."));var s=x((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=0<e?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e){if(10!=t.length)return null;var i=t.split("-");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]))}if(2==e&&19<=t.length){i=(o=(t=t.substring(0,19)).split("T"))[0].split("-");var n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}if(3==e&&16<=t.length){var o;i=(o=(t=t.substring(0,16)).split(" "))[0].split("/"),n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),0)}return null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.DateAdd=function(t,e,i){var n,o=i.valueOf();switch(t){case"ms":n=new Date(o+1*e);break;case"s":n=new Date(o+1e3*e);break;case"mi":n=new Date(o+6e4*e);break;case"h":n=new Date(o+36e5*e);break;case"d":n=new Date(o+864e5*e);break;case"y":n=new Date(o+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()," ",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i,"T",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,r,a,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",r=void 0===n?",":n,(t<0?"-":"")+((l=3<(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)?l%3:0)?a.substr(0,l)+r:"")+a.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+r)+(o?s+Math.abs(t-a).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles")&&(!(!e||null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin"))||-1<localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles").toUpperCase().indexOf(t.toLocaleUpperCase()))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(R))},token:t,providedIn:"root"}),t}(),L=function(){function t(t){this.uti_s=t,this.cancelBeforeStart=!1}return t.prototype.agInit=function(t){var e=this;this.params=t,this.value=this.params.value,0<="1234567890,".indexOf(t.charPress)?(this.value=t.charPress,setTimeout(function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,1,String(e.value).length)},100)):setTimeout(function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,0,String(e.value).length)},100),this.cancelBeforeStart=t.charPress&&"1234567890,".indexOf(t.charPress)<0},t.prototype.getValue=function(){return""==String(this.value)?0:(this.value,null!=this.value?parseFloat(this.value.split(".").join("").split(",").join(".")):0)},t.prototype.isCancelBeforeStart=function(){return this.cancelBeforeStart},t.prototype.isCancelAfterEnd=function(){return 1e6<parseFloat(this.value.split(".").join("").split(",").join("."))},t.prototype.onKeyDown=function(t){console.log("numeric editore: onKeyDown"),this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){this.input.element.nativeElement.focus()},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(t=t||window.event).which?t.keyCode:t.which},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.isKeyPressedNumeric=function(t){var e=this.getCharCodeFromEvent(t);if(console.log(e),8==e)return!0;if(188==e)return!0;if(96<=e&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t.decorators=[{type:l.Component,args:[{selector:"numeric-cell",template:'<input #input (keydown)="onKeyDown($event)" [(ngModel)]="value" style="fontSize:40;height:30px;">'}]}],t.ctorParameters=function(){return[{type:P}]},t.propDecorators={input:[{type:l.ViewChild,args:["input",{read:l.ViewContainerRef}]}]},t}(),F=function(){function t(t){this.uti_s=t,this.label=""}return t.prototype.setDt=function(){console.log(this.appdt.getValue()),this.date_zz=this.appdt.getValue(),this.params.api.stopEditing()},t.prototype.ngAfterViewInit=function(){this.appdt.setFocus()},t.prototype.agInit=function(t){return this.params=t,console.log("agInit"),console.log(this.params),null==t.value?(this.date=null,void(this.date_zz=null)):1970==new Date(t.value).getFullYear()?(this.date=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.date=null,void(this.date_zz=null)):(this.date=new Date(t.value),this.appdt.setValue(this.date),void(this.date_zz=new Date(t.value)))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz.getFullYear().toString()+"-"+this.uti_s.format2cifre(this.date_zz.getMonth()+1)+"-"+this.uti_s.format2cifre(this.date_zz.getDate())+"T00:00:00"},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container fxLayout="row" class="mood" tabindex="0" (keydown)="onKeyDown($event)">\n\n <DtPicker [(ngModel)]="date" #appdt\n [show_buttons]="false" ngDefaultControl\n\n >\n </DtPicker>\n <button mat-raised-button (click)="setDt()">CONFERMA</button>\n\n </div>\n\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n .default {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n .selected {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],t.ctorParameters=function(){return[{type:P}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),j=function(){function t(t){this.sanitizer=t}return t.prototype.transform=function(t){return t},t.decorators=[{type:l.Pipe,args:[{name:"keepHtml",pure:!1}]}],t.ctorParameters=function(){return[{type:p.DomSanitizer}]},t}(),z=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.uti_s=n,this.res="",this.h=0,this.m=0}return t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.ok=function(){5==this.res.length?this.dialogRef.close(this.res):this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.ngOnInit=function(){if(null!=this.m_appService.getState().appo_dialog&&null!=this.m_appService.getState().appo_dialog.val){var t=this.m_appService.getState().appo_dialog.val.split(":");return this.h=parseInt(t[0]),this.m=parseInt(t[1]),void(this.res=this.m_appService.getState().appo_dialog.val)}},t.decorators=[{type:l.Component,args:[{selector:"fhtimeslider",template:'\n\n <h2 mat-dialog-title style="min-width:300px">Seleziona Orario -> {{res}}</h2>\n\n <mat-dialog-content><br><br>\n <table><tr><td>Ore:</td><td>\n <mat-slider\n [max]="23" (change)="change()"\n [min]="0"\n [step]="1"\n thumbLabel\n [(ngModel)]="h">\n </mat-slider>\n</td></tr><tr><td>Minuti:</td><td>\n <mat-slider\n [max]="45"\n [min]="0" (change)="change()"\n [step]="15"\n thumbLabel\n [(ngModel)]="m">\n </mat-slider>\n</td></tr></table>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n <button mat-raised-button (click)="ok()">OK</button>\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R},{type:P}]},t}(),U=function(){function t(t){this.model=t}return t.prototype.onInputChange=function(t,e){for(var i,n=t.toString().split(","),o=0;o<n.length;++o)n[o]=n[o].replace(/\D/g,"");if(0===n.length)i="";else{if(null!==n[0].match(/[0-9]{3}/gim)&&3<n[0].length){var s=Array.from(Array.from(n[0]).reverse().join("").match(/[0-9]{3}/gim).join()).reverse().join(""),r=n[0].replace(s.replace(/\D/g,""),"");i=(0<r.length?r+".":"")+s}else i=n[0];1<n.length&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t.decorators=[{type:l.Directive,args:[{selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}]}],t.ctorParameters=function(){return[{type:u.NgControl}]},t}(),Y=function(){function t(t,e,i,n){this.http=t,this.toastr=e,this.app_s=i,this.uti_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.init_header()}return t.prototype.init_header=function(){null==this.headers&&(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")?(this.headers=new h.HttpHeaders,this.headers=this.headers.append("Content-Type","application/json"),this.headers=this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))):console.log("token non online"))},t.prototype.doQuery=function(t,i){var n=this;if(void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var e=0;e<t.types.length;e++)null==t.values[e]?t.values[e]="dbnull":("boolean"==t.types[e]&&(t.values[e]?t.values[e]="1":t.values[e]="0"),"int"==t.types[e]&&(t.values[e]=""+t.values[e]),"string"==t.types[e]&&(t.values[e]=""+t.values[e]),"date"==t.types[e]&&(t.values[e]=this.uti_s.sql_date(t.values[e])),"datetime"==t.types[e]&&(t.values[e]=this.uti_s.sql_date_time(t.values[e])),"decimal"==t.types[e]&&(t.values[e]=""+t.values[e]),"string"==t.types[e]&&null==t.values[e]&&(t.values[e]="dbnull"));var o=JSON.stringify(t);return this.http.post(this.url,o,{headers:this.headers}).pipe(s.map(function(t){var e;if(t?"KO"===t.result_msg&&(e=new Error(t.msg)):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new N}),s.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),r.throwError(t)}))},t.prototype.downloadfile=function(t){var e=new h.HttpHeaders;return e=e.append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h.HttpClient},{type:c.ToastrService},{type:R},{type:P}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(h.HttpClient),l.inject(c.ToastrService),l.inject(R),l.inject(P))},token:t,providedIn:"root"}),t}(),K=function(){function t(t,e,i,n,o){this._dataService=t,this.dialog=e,this.m_appService=i,this.toastr=n,this.uti_s=o,this.maxore=23,this.label="",this.enabled=!0,this.show_picker=!1,this.selchange=new l.EventEmitter,this.h=0,this.m=0,this.res=""}return t.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},t.prototype.doh=function(){0<this.h&&this.h--,this.sc()},t.prototype.upm=function(){this.m<60&&this.m++,this.sc()},t.prototype.dom=function(){0<this.m&&this.m--,this.sc()},t.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},t.prototype.onMi=function(){59<this.m&&(this.m=59),this.sc()},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(t=t||window.event).which?t.keyCode:t.which},t.prototype.isKeyPressedNumeric=function(t){return console.log(t.key),-1!=="0123456789".indexOf(t.key)||"ArrowRight"==t.key||"ArrowLeft"==t.key||"ArrowDown"==t.key||"ArrowUp"==t.key||"Backspace"==t.key},t.prototype.resetValue=function(){this.h=0,this.m=0},t.prototype.annulla=function(){this.show_picker=!1},t.prototype.ok=function(){0!=this.h||0!=this.m?this.sc():this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.setByDescri=function(t){null==t&&(t="00:00"),""==t&&(t="00:00"),-1==t.indexOf(":")&&(t="00:00");var e=t.split(":");this.h=parseInt(e[0]),this.m=parseInt(e[1])},t.prototype.isValidVal=function(){return!0},t.prototype.setByValue=function(t){this.setByDescri(t)},t.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getHours=function(){return this.h},t.prototype.getMinutes=function(){return this.m},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){this.selchange.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHTimePicker",template:'\n<div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b> \n<div fxLayout="column" fxLayoutAlign="center center">\n<div *ngIf="enabled" class="yourClass">\n<mat-icon (click)="uph()">keyboard_arrow_up</mat-icon></div>\n\n<input style="width:40px;text-align:center;" (keydown)="onKeyDown($event)" (focusout)="onFu()" [disabled]="!enabled" [(ngModel)]="h" >\n<div class="yourClass" *ngIf="enabled">\n<mat-icon class="yourClass" (click)="doh()">keyboard_arrow_down</mat-icon></div>\n\n\n</div>\n <b style="font-size:28px">:</b> \n<div fxLayout="column" fxLayoutAlign="center center">\n<div class="yourClass" *ngIf="enabled">\n<mat-icon class="yourClass" (click)="upm()">keyboard_arrow_up</mat-icon></div>\n\n\n<input style="width:40px;text-align:center;" (keydown)="onKeyDown1($event)" (focusout)="onMi()" [disabled]="!enabled" [(ngModel)]="m" >\n<div class="yourClass" *ngIf="enabled">\n<mat-icon class="yourClass" (click)="dom()">keyboard_arrow_down</mat-icon></div>\n\n\n</div>\n\n',styles:["\n.hhh {\n height: 63px;\n width:100px;\n background-color: rgba(255,0,0,.1);\n}\n.yourClass { cursor: pointer; }\n"]}]}],t.ctorParameters=function(){return[{type:Y},{type:o.MatDialog},{type:R},{type:c.ToastrService},{type:P}]},t.propDecorators={maxore:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],selchange:[{type:l.Output}]},t}(),V=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t.decorators=[{type:l.Component,args:[{selector:"currency-cell",template:"{{params.value | currency:'EUR'}}"}]}],t}(),q=function(){function t(t,e){this.dialogRef=t,this.app_s=e,this.title="",this.msg="",this.title=localStorage.getItem(this.app_s.COMPANY_KEY+"title_dialog"),this.msg=localStorage.getItem(this.app_s.COMPANY_KEY+"msg_dialog")}return t.prototype.setTitle=function(t){this.title=t},t.prototype.setMsg=function(t){this.msg=t},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{styles:["\n "],template:'\n <h1 mat-dialog-title>{{title}}</h1>\n <div mat-dialog-content>{{msg}}</div>\n <div mat-dialog-actions>\n <button mat-button (click)="dialogRef.close(true)" color="primary">CONFERMA</button>\n <button mat-button (click)="dialogRef.close(false)" color="warn">ANNULLA</button>\n </div>\n '}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R}]},t}(),B=function(){function t(t,e,i,n){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=n,this.enabled=!0,this.label="",this.sovrascrivi_path="",this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1}return t.prototype.download_all=function(t){null!=t.APP&&(t.App=t.APP),console.log(this.sovrascrivi_path),""==this.sovrascrivi_path?window.open(this._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename):window.open(this.sovrascrivi_path+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename)},t.prototype["delete"]=function(i){var n=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(q).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="DELETE_ALLEGATO",e.types=["int"],e.values=[i.id],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))},function(t){})}})},t.prototype.ngOnInit=function(){this.upc.single=!1,this.b_mobile=this._appservice.getState().pageFullscreen,this.upc.init(this.App,this.K,"Descrizione Allegato"),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ngOnInit()},t.prototype.ref_allegato=function(){var e=this;if(null!=this.App&&""!=this.App){var t=new D;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.arr_g=t.result_data)},function(t){})}},t.decorators=[{type:l.Component,args:[{selector:"FHUploadPanel",template:'\n <mat-card><mat-card-header>\n <mat-card-title *ngIf="label!=\'\'">\n <h3>{{label}}</h3>\n </mat-card-title></mat-card-header>\n <mat-card-content>\n <div [hidden]="!enabled">\n <FHUpload [single]="b_False" (change)="ref_allegato()" #upc ></FHUpload>\n <br></div>\n <section class="bs">\n <table class="upload-table" width="98%">\n <thead>\n <tr>\n <th *ngIf="!b_mobile">Nome</th>\n <th *ngIf="!b_mobile">Dim.</th>\n <th *ngIf="!b_mobile">Descrizione</th>\n <th *ngIf="!b_mobile">Data</th>\n <th></th>\n <th *ngIf="enabled" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of arr_g">\n <td *ngIf="b_mobile">{{app.Filename}}<br><br> <button (click)="download_all(app)" mat-raised-button >DOWNLOAD</button> </td>\n <td *ngIf="!b_mobile">{{app.Filename}}</td>\n <td *ngIf="!b_mobile">{{app.Filesize}}</td>\n <td *ngIf="!b_mobile">{{app.descrizione}}</td>\n <td *ngIf="!b_mobile">{{app.dt_ins | date: \'dd/MM/yyyy hh:mm:ss\'}}</td>\n <td *ngIf="!b_mobile">\n <button mat-icon-button\tmatTooltip="Scarica File" (click)="download_all(app)"><mat-icon>cloud_download</mat-icon></button>\n </td>\n\n <td><a mat-icon-button \tmatTooltip="Elimina File" *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n\n </tr>\n </table>\n </section>\n\n </mat-card-content>\n </mat-card>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n .upload-table {\n border: 0;\n text-align: left;\n\n thead {\n tr {\n font-size:16px;\n font-weight:bold;\n color:white;\n background-color:#015488;\n border-bottom: 1px solid gray;\n }\n }\n }\n "]}]}],t.ctorParameters=function(){return[{type:R},{type:Y},{type:c.ToastrService},{type:o.MatDialog}]},t.propDecorators={enabled:[{type:l.Input}],label:[{type:l.Input}],sovrascrivi_path:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}]},t}(),H=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.progress_p=0,console.log("constructor()")}return t.prototype.update_progess=function(t){this.progress_p=t,console.log(this.progress_p),100==t&&this.dialogRef.close()},t.prototype.ngOnInit=function(){console.log("ngOnInit()")},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\n {{label|uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <mat-progress-bar style="height:50px" color="accent" mode="determinate" value="{{progress_p}}"></mat-progress-bar>\n\n\n </mat-dialog-content>\n\n\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),G=function(){function t(t,e,i,n){var o=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=n,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 500MB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.change=new l.EventEmitter,this.upload_ended=new l.EventEmitter,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.progress_p=0,this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.uploader=new d.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:524288e3}),this.username=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(o.descrizione="",o.toastr.info("INFO",o.allegato_inserito,{timeOut:1e3,progressBar:!0}),o.ref_allegato(),o.change.emit())}}return t.prototype.ngOnInit=function(){var o=this,t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],console.log(t),this.uploader.setOptions(t),this.uploader.onCompleteAll=function(){o.loading=!1,o.upload_ended.emit()},this.uploader.onErrorItem=function(t,e,i,n){o.toastr.error(e)},this.uploader.onAfterAddingFile=function(){o.ch()},this.uploader.onProgressItem=function(t,e){o.loading=!0,null!=o.dialogRef&&null!=o.dialogRef.componentInstance&&o.dialogRef.componentInstance.update_progess(e)},this.uploader.onWhenAddingFileFailed=function(t,e,i){switch(e.name){case"fileSize":var n=Math.round(t.size/1024/1024);o.toastr.error(o.limit_string.split("<size>").join(""+n));break;default:o.toastr.error("Errore: "+e.name)}}},t.prototype.download_all=function(){window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(){var i=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this.inserire_descrizione):(this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",i.tipo),e.append("local_path",i.app_s.LOCAL_PATH),""!=i.programma_da_eseguire&&e.append("p1",i.programma_da_eseguire)},this.dialogRef=this.dialog.open(H,{disableClose:!0}),this.dialogRef.componentInstance.label=this.label_attendere,this.dialogRef.afterClosed().subscribe(function(t){}),this.uploader.uploadAll())},t.prototype.init=function(t,e,i,n,o){void 0===n&&(n=""),void 0===o&&(o=""),this.App=t,this.K=e,this.label=i,this.tipo=n,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=o,this.ref_allegato()},t.prototype.ref_allegato=function(){var i=this;if(this.single&&null!=this.App&&""!=this.App){var t=new D;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;0<e.length&&(i.descrizione=e[0].descrizione,i.file_name=e[0].Filename,i.label_b="Download ("+e[0].Filename+" - "+e[0].Filesize+")",i.b_edit_loaded=!0)}},function(t){})}},t.decorators=[{type:l.Component,args:[{selector:"FHUpload",template:'\n <div *ngIf="loading" fxLayout="row">\nWAIT\n </div>\n <div *ngIf="enabled && !loading" fxLayout="row">\n <mat-form-field class="field_style">\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}} {{fixed_label}}">\n </mat-form-field>\n <input type="file" ng2FileSelect [uploader]="uploader" multiple />\n <div><button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button></div>\n </div>\n <div *ngIf="!enabled">\n <label>{{label}}:</label>{{descrizione}}\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Y},{type:c.ToastrService},{type:o.MatDialog},{type:R}]},t.propDecorators={enabled:[{type:l.Input}],single:[{type:l.Input}],descri_obb:[{type:l.Input}],programma_da_eseguire:[{type:l.Input}],label_attendere:[{type:l.Input}],fixed_label:[{type:l.Input}],limit_string:[{type:l.Input}],allegato_inserito:[{type:l.Input}],inserire_descrizione:[{type:l.Input}],change:[{type:l.Output}],upload_ended:[{type:l.Output}]},t}(),Q=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),W=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{styles:["\nagm-map {\n height: 600px;\n width:100%;\n}\n "],template:'\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n <mat-tab-group>\n <mat-tab label="FILTRI">\n\n\n <img src="assets/helps/fhgrid/filtri.png" />\n </mat-tab>\n <mat-tab label="ORDINAMENTI">\n <img src="assets/helps/fhgrid/ordinamenti.png" />\n </mat-tab>\n <mat-tab label="LAYOUT COLONNE">\n <img src="assets/helps/fhgrid/layout_colonne.png" />\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t}(),J=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars||this.valore.length>this.max_chars?this.toastr.error("Il valore deve avere un numero di caratteri compreso tra "+this.min_chars+" - "+this.max_chars):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}} (min {{min_chars}} - max {{max_chars}} caratteri)" type="text" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button mat-raised-button color="warn" (click)="chiudi()">ANNULLA</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Z=function(){function t(){this.filter="",this.system_dest=1}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),$=function(){function t(t,e,i,n,o,s,r){var a=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=n,this.slimLoadingBarService=o,this.m_dialog=s,this.uti_s=r,this.end_point=this.m_appService.API_ENDPOINT+this.m_appService.GRID_ENDPOINT,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.auto_height=!0,this.abilita_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.g_width="100%",this.g_height="100%",this.init_fill=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new l.EventEmitter,this.cell_edited=new l.EventEmitter,this.clicked=new l.EventEmitter,this.dclicked=new l.EventEmitter,this.columndclicked=new l.EventEmitter,this.cell_clicked=new l.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new l.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(n){a.slimLoadingBarService.start(function(){});var o=new Z;if(o.table=a.tbl_name,o.table_count=a.tbl_name,""!=a.count_tbl_name&&(o.table_count=a.count_tbl_name),console.log(n),o.num_per_pag=n.endRow-n.startRow,o.curr_page=Math.round(n.startRow/o.num_per_pag),null==o.curr_page&&(o.curr_page=0),null==o.num_per_pag&&(o.num_per_pag=100),o.sort_field=a.sort_field,null!=n.sortModel&&0<n.sortModel.length){o.sort_field="";for(var t=0;t<n.sortModel.length;t++)""!=o.sort_field&&(o.sort_field=o.sort_field+","),"autori"==n.sortModel[t].colId?o.sort_field=o.sort_field+"case when CHARINDEX('"+localStorage.getItem(a.m_appService.COMPANY_KEY+"user")+"',autori)>0 then 1 else 0 end "+n.sortModel[t].sort:o.sort_field=o.sort_field+n.sortModel[t].colId+" "+n.sortModel[t].sort}if(o.system_dest=a.system_dest,o.field=a.fields,null!=a.filters&&(o.filter=a.filters),""!=a.fix_flt&&(""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+" ("+a.fix_flt+" )"),""!=a.fix_flt_temp&&(""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+" ("+a.fix_flt_temp+" )"),null!=n.filterModel)for(var e in n.filterModel)if(null!=n.filterModel[e].type)null!=n.filterModel[e].filter&&(a.show_pulisci_filtri=!0,""!=o.filter&&(o.filter=o.filter+" and "),"number"==n.filterModel[e].filterType?("greaterThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" > "+n.filterModel[e].filter),"equals"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" = "+n.filterModel[e].filter),"notEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <> "+n.filterModel[e].filter),"lessThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" < "+n.filterModel[e].filter),"lessThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <= "+n.filterModel[e].filter),"greaterThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" >= "+n.filterModel[e].filter),"inRange"==n.filterModel[e].type&&(o.filter=o.filter+" ("+e+" >= "+n.filterModel[e].filter+" and "+e+" <= "+n.filterModel[e].filterTo+")")):("contains"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") like '%"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"startsWith"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") like '"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"equals"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") = '"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"notContains"==n.filterModel[e].type&&(o.filter=o.filter+"not upper("+e+") like '%"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"%'"),"notEqual"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") <> '"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"'"),"endsWith"==n.filterModel[e].type&&(o.filter=o.filter+" upper("+e+") like '%"+n.filterModel[e].filter.replace("'","''").toUpperCase()+"'"))),null==n.filterModel[e].dateTo&&null==n.filterModel[e].dateFrom||(a.show_pulisci_filtri=!0,""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+" (",null!=n.filterModel[e].dateFrom&&null!=n.filterModel[e].dateTo&&(o.filter=o.filter+e+">='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),null!=n.filterModel[e].dateTo?(null!=n.filterModel[e].dateFrom&&(o.filter=o.filter+" and "),o.filter=o.filter+e+"<='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateTo,1))+"'"):null!=n.filterModel[e].dateFrom&&("greaterThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"equals"==n.filterModel[e].type&&(o.filter=o.filter+" ("+e+" >='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"' and "+e+" <='"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+" 23:59:00')"),"notEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <> '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"lessThan"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"lessThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'"),"greaterThanOrEqual"==n.filterModel[e].type&&(o.filter=o.filter+" "+e+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(n.filterModel[e].dateFrom,1))+"'")),o.filter=o.filter+" )");else{a.show_pulisci_filtri=!0;var i="";for(t=0;t<n.filterModel[e].length;t++)null!=n.filterModel[e][t]&&(""!=i&&(i+=","),i=i+"'"+n.filterModel[e][t].replace("'","''")+"'");""!=i?(""!=o.filter&&(o.filter=o.filter+" and "),o.filter=o.filter+e+" in ("+i+")"):""!=o.filter&&(o.filter=o.filter+" and 1=0")}(a.str_curr_q_p="")!=o.filter&&(a.str_curr_q_p="where "+o.filter),""!=o.sort_field&&(a.str_curr_q_p=a.str_curr_q_p+" order by "+o.sort_field),a.curr_filter=o.filter,a._gridservice.url=a.end_point,a._gridservice.doQuery(o).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){e=!0,n.successCallback(t.result_data,t.count),a.b_init=!0,a.myData=t.result_data.slice(),a.num_r=t.count,a.slimLoadingBarService.complete(),a.fill_end.emit(),localStorage.setItem(a.grid_key+"_POS1",JSON.stringify(o)),null!=localStorage.getItem(a.grid_key+"_POS2")&&null!=a.gridOptions&&null!=a.gridOptions.api&&a.gridOptions.api.forEachNode(function(t){a.getRowNodeId(t)===localStorage.getItem(a.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(a.grid_key+"_POS2"))});var i=!1;null!=a.toggle_mantieni&&(i=a.toggle_mantieni.checked),a.b_init1||i||a.autoSizeAll(),a.b_init1=!0,a.ensure_visible(),!a.show_buttons&&a.first_ref&&(a.first_ref=!1),null==localStorage.getItem(a.grid_key+"_COLS")&&setTimeout(function(){a.autoSizeAll()},300)}e||(a.errorMsg=t.msg+" ["+t.result_msg+"]")},function(t){a.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"})}},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!0,enableServerSideFilter:!0,enableColResize:!0,rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return a.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore",greaterThan:"Maggiore",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj=new Object)}return t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0))},t.prototype.edit_config=function(){var s=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(q,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[s.gf.getDescri(),s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var s=this;this.win_opt=this.m_dialog.open(J,{disableClose:!0}),this.win_opt.componentInstance.title="Salva Configurazione",this.win_opt.componentInstance.label="Nome",this.win_opt.afterClosed().subscribe(function(t){if(t&&null!=t){var e=new D;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[t,s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},t.prototype.getContextMenuItems=function(){var t=this,e=["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel",{name:"Esporta",action:function(){t.onBtExport()}}];return this.abilita_export||(e=new Array("autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel")),console.log(e),e},t.prototype.onBtExport=function(){var t={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(t){if(t.value){if(null==t.value)return"";if("function"==typeof t.value.getMonth)return this.uti_s.pad(t.value.getDate(),2)+"/"+this.uti_s.pad(t.value.getMonth()+1,2)+"/"+t.value.getFullYear();if(24==t.value.length&&-1<t.value.indexOf(":00.000Z")){console.log(new Date(t.value));var e=new Date(t.value);return this.uti_s.pad(e.getDate(),2)+"/"+this.uti_s.pad(e.getMonth()+1,2)+"/"+e.getFullYear()+" "+this.uti_s.pad(e.getHours(),2)+":"+this.uti_s.pad(e.getMinutes(),2)}return t.value}}};this.gridOptions.api.exportDataAsExcel(t)},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t?this.uti_s.newGuid():null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngOnInit=function(){this.end_point=this.m_appService.API_ENDPOINT+this.m_appService.GRID_ENDPOINT,this.end_point!=this._gridservice.url&&(this._gridservice.url=this.end_point),this.onResize()},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(W,{disableClose:!0}).afterClosed().subscribe(function(t){})},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){console.log("autoSizeAll");var e=[];this.columnDefs.forEach(function(t){e.push(t.field)}),this.gridOptions.columnApi.autoSizeColumns(e,null),this.save_cfg()},t.prototype.fitSizeAll=function(){console.log("fitSizeAll"),this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var e=0;return this.gridOptions.api.forEachNode(function(t){t.isSelected()&&e++}),e},t.prototype.getquerySelected=function(e,t){var i="";return"String"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i=i+"'"+t.data[e]+"'")}),console.log("ENTRO "+e+" "+t),"Number"==t&&(console.log("CERCO SEL"),this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(console.log("selected"),""!=i&&(i+=","),i+=t.data[e])})),i},t.prototype.selectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!0)})},t.prototype.deselectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!1)})},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(this.ric_libera=""),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;null!=this.columnDefs&&0!=this.columnDefs.length?this.ckk_ed||(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),this.init_fill&&setTimeout(function(){t.ref_dt()},100)):setTimeout(function(){t.ckk()},500)},t.prototype.res_columns=function(t){void 0===t&&(t=!1);var e=!1;if(null!=this.toggle_mantieni&&(e=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_COLS"))try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),null)}catch(i){console.log(i)}try{this.gridOptions.api.setSortModel(null)}catch(i){console.log(i)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(i){console.log(i)}try{this.gridOptions.api.setFilterModel(null)}catch(i){console.log(i)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER")){console.log(localStorage.getItem(this.grid_key+"_FILTER"));try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(i){console.log(i)}}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions?setTimeout(function(){t.ref_dt()},500):null==this.gridOptions.api?setTimeout(function(){t.ref_dt()},500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){console.log(this.header_h),this.setHeaderHeight(this.header_h),null!=this.gf&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,console.log("onready_go"),setTimeout(function(){t.ckk()},10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",void this.doFill("",!0,!1);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)2<t[i].length?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onAfterFilterChanged=function(){localStorage.removeItem(this.grid_key+"_POS"),this.b_init&&(console.log("salvo f: "+JSON.stringify(this.gridOptions.api.getFilterModel())),localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel())))},t.prototype.onFilterModified=function(){this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t),console.log("onColumnEvent: "+t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout(function(){n.ckk()},10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout(function(){i.ckk()},10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.decorators=[{type:l.Component,args:[{selector:"FHGrid",template:'<table [hidden]=\'!show_buttons\'><tr>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'><h5>{{num_r+label_elementi}}</h5>\n </td>\n <td style="vertical-align:\'bottom\'"> <mat-form-field>\n <input matInput [placeholder]="trova_label" (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera" style="width:200px">\n </mat-form-field> </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button *ngIf="show_pulisci_filtri" mat-raised-button (click)="pulisci_filtri()" color="warn"> <mat-icon>clear</mat-icon> REMOVE FILTER</button>\n </td> <td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button mat-raised-button (click)="autoSizeAll()" color="accent"> <mat-icon>photo_size_select_small</mat-icon> AUTO SIZE</button>\n </td> <td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button mat-raised-button (click)="fitSizeAll()" color="accent"> <mat-icon>aspect_ratio</mat-icon> FIT SIZE</button>\n <td *ngIf="show_buttons && !this.m_appService.getState( ).mobile">\n <div fxLayout="row" fxLayoutAlign="center center">\n \n <FHComboBox (selchange)="ch_config()" (fillend)="fe_cfg()" #gf init_fill="false"></FHComboBox>\n \n <div matTooltip="Modifica Preferenza" matTooltipPosition="above">\n <button [hidden]=\'this.m_appService.getState().pageFullscreen\' mat-icon-button *ngIf="curr_config!=\'-1\'" style="color:rgb(248, 105, 10)">\n <mat-icon (click)="edit_config()" >save</mat-icon>\n </button> </div> \n <div matTooltip="Crea Nuova Preferenza" matTooltipPosition="above">\n <button [hidden]=\'this.m_appService.getState().pageFullscreen\' mat-icon-button style="color:rgb(16, 98, 16)">\n <mat-icon (click)="insert_config()">library_add</mat-icon>\n </button></div> <mat-slide-toggle [hidden]=\'this.m_appService.getState().pageFullscreen\' (click)="ck_flag()" #toggle_mantieni >{{mantieni_impostazioni}}</mat-slide-toggle>\n \n\n </div>\n\n </td><td [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> \n <button *ngIf="show_help" mat-raised-button (click)="help_window()" color="accent"> <mat-icon>help</mat-icon> HELP</button>\n </td>\n\n\n </tr>\n </table>\n <div [hidden]=\'this.m_appService.getState().pageFullscreen\' *ngIf="!show_buttons && !this.m_appService.getState( ).mobile && show_num_elem"><h5>{{num_r+\' Elementi\'}}</h5></div>\n\n <ag-grid-angular ref-agGrid (cellDoubleClicked)="onColumnEvent($event)" (cellClicked)="onCellClicked($event)" [headerHeight]="header_h" [groupHeaderHeight]="header_h"\n class="ag-theme-balham" [singleClickEdit]="true" style="width: 100%; height: 100%;" [gridOptions]="gridOptions" [columnDefs]="columnDefs"\n [rowData]="rowData" enableColResize enableServerSideSorting enableServerSideFilter enableColResize\n (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()" (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)" (columnVisible)="oncolumnEverythingChanged($event)" (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)" (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()" [paginationPageSize]="num_per_pag" (gridReady)="onReady($event)">\n </ag-grid-angular>\n',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Q},{type:c.ToastrService},{type:Y},{type:R},{type:_.SlimLoadingBarService},{type:o.MatDialog},{type:P}]},t.propDecorators={end_point:[{type:l.Input}],tbl_name:[{type:l.Input}],columnDefs:[{type:l.Input}],count_tbl_name:[{type:l.Input}],num_per_pag:[{type:l.Input}],grid_key:[{type:l.Input}],sort_field:[{type:l.Input}],fields:[{type:l.Input}],filters:[{type:l.Input}],auto_height:[{type:l.Input}],abilita_export:[{type:l.Input}],enabled_pag:[{type:l.Input}],show_help:[{type:l.Input}],show_num_elem:[{type:l.Input}],system_dest:[{type:l.Input}],header_h:[{type:l.Input}],g_width:[{type:l.Input}],g_height:[{type:l.Input}],init_fill:[{type:l.Input}],label_elementi:[{type:l.Input}],trova_label:[{type:l.Input}],mantieni_impostazioni:[{type:l.Input}],show_buttons:[{type:l.Input}],fill_end:[{type:l.Output}],cell_edited:[{type:l.Output}],clicked:[{type:l.Output}],dclicked:[{type:l.Output}],columndclicked:[{type:l.Output}],cell_clicked:[{type:l.Output}],gf:[{type:l.ViewChild,args:["gf"]}],toggle_mantieni:[{type:l.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:l.Output}],off_set:[{type:l.Input}],onResize:[{type:l.HostListener,args:["window:resize",["event"]]}],testom:[{type:l.ViewChild,args:["testom",{read:l.ViewContainerRef}]}],myModalNormal:[{type:l.ViewChild,args:["myModalNormal",{read:l.ViewContainerRef}]}]},t}(),X=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.types=new Array,this.values=new Array,this.label="",this.width="100%",this.enabled=!0,this.sel_label="",this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1"}return t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1"},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array},t.prototype.fillCombo=function(){var i=this;if(console.log("fillcombo "+this.sql),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var t=new D;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.sql+"]"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.sql+"]"})}else this.set_options(this.sql)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return void(this.selval=""+this.myData[e].valore)},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t){this.selval=""+this.myData[e].valore;break}},t.prototype.getDescri=function(){if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){return null==this.selval?"-1":""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){},t.prototype.ngOnInit=function(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.sc=function(){console.log("-----------sc---------------"),this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.decorators=[{type:l.Component,args:[{selector:"FHComboBox",template:'\n<mat-form-field>\n <mat-select placeholder="{{label}}" #cmb [disabled]="!enabled" [(ngModel)]="selval" (selectionChange)="sc()" style="width:100%;">\n <mat-option value="-1">{{sel_label}}</mat-option>\n <mat-option value="{{app.valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</mat-option>\n </mat-select>\n </mat-form-field>\n',styles:["\n\n"]}]}],t.ctorParameters=function(){return[{type:Y},{type:w}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],label:[{type:l.Input}],width:[{type:l.Input}],enabled:[{type:l.Input}],sel_label:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}],valDef:[{type:l.Input}],db_type:[{type:l.Input}]},t}(),tt=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.label="",this.types=new Array,this.values=new Array,this.db_type="1",this.enabled=!0,this.only_from_list=!1,this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.focusout=new l.EventEmitter,this.sItem="",this.searchItemsFiltered=new Array,this.is_loaded=!1,this.selval=null,this.errorMsg="",this.valDef="",this.table_hidden=!0}return t.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},t.prototype.fo_search=function(){this.focusout.emit()},t.prototype.onChange=function(t){if(this.searchItemsFiltered=new Array,null!=this.sItem)if(""!=this.sItem){this.searchItemsFiltered=new Array;for(var e=this.sItem.toLowerCase(),i=0;i<this.myData.length&&(null!=this.myData[i].descrizione_valore&&-1!=this.myData[i].descrizione_valore.toLowerCase().indexOf(e)&&this.searchItemsFiltered.push(this.myData[i]),20!=this.searchItemsFiltered.length);i++);}else for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},t.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.selchange.emit({event:t,valore:this.getValue(),descrizione_valore:this.getDescri()})},t.prototype.myListFormatter=function(t){return t.descrizione_valore},t.prototype.resetValue=function(){var t=this;setTimeout(function(){t.selval="",t.valDef="",t.sItem="",t.selval=null},100)},t.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},t.prototype.fillCombo=function(){var i=this;this.myData=new Array,this.searchItemsFiltered=new Array;var t=new D;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.prototype.resetD=function(t){this.myData=t,this.selval="",this.fillend.emit(),this.table_hidden=!1,this.errorMsg="",this.setByValue(this.valDef),this.is_loaded=!0,null!=this.getValue()&&""!=this.getValue()||""==this.valDef||this.setByDescri(this.valDef)},t.prototype.setByDescri=function(t){if(this.valDef=t,(this.selval="")!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.sItem=t,void(this.selval=this.myData[e].valore);this.only_from_list||(this.sItem=t)}},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval=t,null!=this.myData)for(var e in this.myData)if(this.myData[e].valore==this.selval){this.sItem=this.myData[e].descrizione_valore;break}},t.prototype.getDescri=function(){return this.getData("descrizione_valore")},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.only_from_list||"descrizione_valore"!=t?null:this.sItem},t.prototype.getObj=function(){for(var t in this.myData)if(this.myData[t].valore==this.selval)return this.myData[t];return null},t.prototype.getValue=function(){return this.getData("valore")},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.table_hidden=!1,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngOnInit=function(){if(this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHAutoComplete",template:'\n<mat-form-field class="field_style">\n<input matInput class="field_style" [disabled]="!enabled" [matAutocomplete]="auto" [placeholder]="label" (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search()" #searchp >\n</mat-form-field>\n<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)">\n<mat-option *ngFor="let objx of searchItemsFiltered" class="search_home" [value]="objx.descrizione_valore" >\n\n {{ objx.descrizione_valore }}\n</mat-option>\n</mat-autocomplete>\n\n\n <div class="ui negative message" *ngIf="errorMsg != \'\'">\n <i class="close icon"></i>\n <div class="header">\n {{errorMsg}}\n </div>\n </div>\n'}]}],t.ctorParameters=function(){return[{type:Y},{type:w}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],label:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],db_type:[{type:l.Input}],enabled:[{type:l.Input}],only_from_list:[{type:l.Input}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}],focusout:[{type:l.Output}],searchp:[{type:l.ViewChild,args:["searchp"]}],auto:[{type:l.ViewChild,args:["auto"]}]},t}(),et=function(){function t(t,e){this.dateAdapter=t,this.uti_s=e,this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new l.EventEmitter,this.v_view=this.uti_s.date2String(new Date),this.date_sel=null,this.v_date_sel="",this.dateAdapter.setLocale("it")}return t.prototype.dt_chg=function(t){console.log(t);var e=t.split("/");3==e.length&&parseInt(e[2])<3e3&&0<parseInt(e[0])&&parseInt(e[0])<=31&&1<parseInt(e[1])&&parseInt(e[1])<=12&&(this.date_sel=new Date(parseInt(e[2]),parseInt(e[1])-1,parseInt(e[0])))},t.prototype.chxx=function(t){console.log(t)},t.prototype.ch=function(t){this.change.emit(this.getValue())},t.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},t.prototype.dt_ch=function(){var t=this;setTimeout(function(){console.log(t.date_sel),t.change.emit()},50)},t.prototype.add_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,this.date_sel.getMonth(),this.date_sel.getDate()),this.v_view=this.uti_s.date2String(this.date_sel),this.change.emit(this.getValue())},t.prototype.ini_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.date_sel),this.change.emit(this.getValue())},t.prototype.fin_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.date_sel),this.change.emit(this.getValue())},t.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){this.dateAdapter.setLocale("it"),null!=t?(null!=t.value&&(t=new Date(t.value)),this.date_sel=new Date(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.date_sel)):this.date_sel=null},t.decorators=[{type:l.Component,args:[{selector:"FHDatePicker",providers:[{provide:o.MAT_DATE_LOCALE,useValue:"it-IT"}],template:'\n<div [hidden]="!show_buttons||!enabled"><button mat-raised-button (click)="add_year()">+1 Anno</button>\n<button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n<button mat-raised-button (click)="fin_year()">Fine Anno</button>\n</div>\n\n<mat-form-field (click)="chxx($event)">\n<input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event.target.value)" (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" placeholder="{{label}}">\n<mat-datepicker-toggle matSuffix [for]="picker" (click)="chxx($event)"></mat-datepicker-toggle>\n<mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>\n</mat-form-field>\n\n',styles:["\n .lb_small_grigia{\n font-size: 12px;\n color: #B8B8B8;\n}\n .label_dis{\n font-size: 14px;\n font-weight: bold;\n}\n"]}]}],t.ctorParameters=function(){return[{type:o.DateAdapter},{type:P}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],pickerId:[{type:l.ViewChild,args:["pickerId"]}]},t}(),it=function(){function t(t,e,i){this._dataService=t,this.dialogRef=e,this.toastr=i,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.single_sel=!1,this.vis_buttons=!0,this.all_users=!1,this.user_sel=new Array}return t.prototype.filtra=function(){this.users_list_sel=new Array;for(var t=0;t<this.users_list.length;t++)if(null!=this.users_list[t].nc){var e=!1;console.log(this.users_list[t].username),console.log(this.users_list_sel);for(var i=0;i<this.users_list_sel.length;i++)if(this.users_list_sel[i].username==this.users_list[t].username){e=!0;break}if(console.log(e),!e&&(-1!=this.users_list[t].nc.toUpperCase().indexOf(this.fltr_user.toUpperCase())||""==this.fltr_user))if(console.log("this.user_sel"),console.log(this.user_sel),null==this.user_sel)this.users_list_sel.push(this.users_list[t]);else{for(var n=!1,o=0;o<this.user_sel.length;o++)if(this.user_sel[o].username==this.users_list[t].username){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}console.log("this.users_list_sel"),console.log(this.users_list_sel)},t.prototype.ngOnInit=function(){var e=this;if(this.all_users){var t=new D;t.sql="SELECT_ALL_USERS",t.types=[],t.values=[],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.users_list=t.result_data,e.filtra())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})}else{if(null!=this.user_sel&&0<this.user_sel.length)return;if(this.users_list_sel=new Array,null!=this.users_list)for(var i=0;i<this.users_list.length;i++)this.users_list_sel.push(this.users_list[i])}},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&this.users_list.splice(t,1),this.single_sel&&(this.user_sel=new Array),this.user_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.user_sel.indexOf(this.selectedRemove,0);-1<t&&this.user_sel.splice(t,1),this.users_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelArr=function(){return this.user_sel},t.decorators=[{type:l.Component,args:[{selector:"FHPickUsers",template:'\n <mat-card>\n <mat-card-content>\n <div fxLayout="row" fxFlex >\n <div fxLayout="column" fxFlex="41%">\n\n <div style="text-align: center;">\n <b>Seleziona Utenti</b>\n </div>\n <br><br>\n <div fxLayout="row">\n <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()" style=\'padding:8px;margin:15px auto;width:100%;\' placeholder=\'Ricerca...\'>\n\n </div>\n <div style="width:100%;height:250px;overflow:auto;">\n <section class="bs">\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of users_list_sel" (click)="addTo(u)" (dblclick)="do_add()" class="selector" [ngClass]="{ \'active\': selectedAdd == u }">\n <td>{{u.nc}} {{u.canale}}</td>\n\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n </div>\n <div fxLayout="column" fxFlex="18%" style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-raised-button (click)="do_add()" [disabled]="!option"><mat-icon>arrow_forward</mat-icon> </button>\n <br><br>\n <button mat-raised-button (click)="do_rem()" [disabled]="option"> <mat-icon>delete</mat-icon> </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n <div style="text-align: center;">\n <b>Utenti Selezionati</b>\n </div>\n <br><br>\n <div style="width:100%;height:250px;overflow:auto;">\n <section class="bs">\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of user_sel" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector" [ngClass]="{ \'active\': selectedRemove == u }">\n <td>{{u.nc}} {{u.canale}}</td>\n\n </tr>\n </tbody>\n </table></section>\n </div>\n </div>\n </div>\n <br>\n <div style="text-align: center;" *ngIf="vis_buttons" >\n <button mat-raised-button color="primary" (click)="dialogRef.close(false)">Ok</button>\n <button mat-raised-button (click)="dialogRef.close(false)">Annulla</button>\n </div>\n </mat-card-content>\n\n</mat-card>\n',styles:["\n .selector:hover{\n background-color:#fafafa;\n cursor:pointer;\n }\n .active{\n background-color:#fafafa;\n cursor:pointer;\n }\n .fabeOut{\n display: block;\n background-color: rgba(0,0,0,.5);\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n\n pointer-events: auto;\n -webkit-transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n }\n .cardFloat{\n\n }\n\n"]}]}],t.ctorParameters=function(){return[{type:Y},{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={users_list:[{type:l.Input}],users_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],all_users:[{type:l.Input}],user_sel:[{type:l.Input}]},t}(),nt=function(){function t(){this.val_app=-1}return t.prototype.ok=function(){this.val_app=1,this.params.api.stopEditing()},t.prototype.ko=function(){this.val_app=0,this.params.api.stopEditing()},t.prototype.nd=function(){this.val_app=-1,this.params.api.stopEditing()},t.prototype.ngAfterViewInit=function(){},t.prototype.agInit=function(t){this.params=t},t.prototype.getValue=function(){return this.val_app},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"approva-cell",template:'\n <div #container class="mood">\n\n <div class="example-mat-buttons">\n \n <button mat-icon-button style="color:green" (click)="ok()">\n <mat-icon>thumb_up</mat-icon>\n </button>\n <button mat-icon-button style="color:red" (click)="ko()">\n <mat-icon>thumb_down</mat-icon>\n </button>\n <button mat-icon-button style="color:gray" (click)="nd()">\n <mat-icon>crop_din</mat-icon>\n </button>\n </div>\n\n \n </div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n \n \n "]}]}],t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}]},t}(),ot=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.THOUSANDS_SEPARATOR))+s},t.prototype.parse=function(t,e){void 0===e&&(e=2);var i=x((t||"").split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return n=n.replace(new RegExp(this.THOUSANDS_SEPARATOR,"g"),""),s=0<parseInt(s,10)&&0<e?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",t},t.decorators=[{type:l.Pipe,args:[{name:"FHCurrency"}]}],t.ctorParameters=function(){return[]},t}(),st=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngOnInit=function(){this.el.value=this.currencyPipe.transform(this.el.value)},t.prototype.onFocus=function(t){this.el.value=this.currencyPipe.parse(t)},t.prototype.onBlur=function(t){this.el.value=this.currencyPipe.transform(t)},t.decorators=[{type:l.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],t.ctorParameters=function(){return[{type:l.ElementRef},{type:ot}]},t.propDecorators={onFocus:[{type:l.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:l.HostListener,args:["blur",["$event.target.value"]]}]},t}(),rt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title="",this.sql_dett="",this.descri="",this.lat=51.673858,this["long"]=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],null!=this.m_appService.getState().appo_dialog&&(null!=this.m_appService.getState().appo_dialog.zoom&&(this.zoom=this.m_appService.getState().appo_dialog.zoom),null!=this.m_appService.getState().appo_dialog.title&&(this.title=this.m_appService.getState().appo_dialog.title),null!=this.m_appService.getState().appo_dialog.lat&&(this.lat=this.m_appService.getState().appo_dialog.lat),null!=this.m_appService.getState().appo_dialog["long"]&&(this["long"]=this.m_appService.getState().appo_dialog["long"]),null!=this.m_appService.getState().appo_dialog.descri&&(this.descri=this.m_appService.getState().appo_dialog.descri),null!=this.m_appService.getState().appo_dialog.markers&&(this.markers=this.m_appService.getState().appo_dialog.markers),console.log("zoom: "+this.zoom))}return t.prototype.apri_Scheda=function(t){console.log(t),window.open(t)},t.prototype.clickedMarker=function(t,e,i){this.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{styles:["\nagm-map {\n height: 600px;\n width:100%;\n}\n "],template:'\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n\n <agm-map [zoom]="zoom" width="100%" height="100%" [latitude]="lat" [longitude]="long">\n <agm-marker\n *ngFor="let m of markers; let i = index"\n (markerClick)="clickedMarker(m.labelx, infoWindow, i)"\n [latitude]="m.lat"\n [longitude]="m.lng"\n [label]="m.label"\n >\n <agm-info-window #infoWindow>\n\n <strong>{{m.labelx}}</strong><br>\n <button *ngIf="m.url_scheda!=null" (click)="apri_Scheda(m.url_scheda)">APRI SCHEDA</button>\n </agm-info-window>\n </agm-marker>\n </agm-map>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t}(),at=function(){function t(){this.text="",this.date_zz="",this.date_v="",this.label=""}return t.prototype.setDt=function(){this.date_zz=this.text},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout(function(){return t.appdt.nativeElement.focus()},500)},t.prototype.agInit=function(t){return null==(this.params=t).value?(this.text=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.text=null,void(this.date_zz=null)):(this.text=t.value,void(this.date_zz=t.value))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&13!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood" >\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field>\n <textarea matInput style="min-height:180px;min-width:400px" [(ngModel)]="text" #appdt placeholder="{{label}}"></textarea>\n </mat-form-field>\n </div>\n\n <button mat-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n .default {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n .selected {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),lt=function(){function t(t){this._dataService=t,this.selval="",this.date_zz="",this.date_v="",this.sql="",this.label="",this.myData=new Array}return t.prototype.setDt=function(){this.date_zz=this.selval},t.prototype.ngAfterViewInit=function(){},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new D;i.sql=t.sql,i.types=t.types,i.values=t.values,this._dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data)},function(t){}),null!=t.value&&-1==t.value.indexOf("--")&&(this.selval=t.value,this.date_zz=t.value)},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){t.which||t.keyCode},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood" >\n <div style="min-width:350px;min-height:60px;text-align=center" >\n\n <select [(ngModel)]="selval" #appdt style="min-height:40px;width:90%">\n <option value="{{app.descrizione_valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</option>\n </select>\n </div>\n <br><br><br>\n <button mat-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align:center;\n display:inline-block;\n outline:none\n }\n .default {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n .selected {\n padding-left:10px;\n padding-right:10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],t.ctorParameters=function(){return[{type:Y}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),pt=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.label="",this.enabled=!0,this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.upd_f=function(t,e){var i=new Object;i.u=t,i.b=e,this.selchange.emit(i)},t.prototype.resetValue=function(){for(var t=0;t<this.myData.length;t++)this.myData[t].checked=!1},t.prototype.reset=function(){this.myData=new Array,this.resetValue()},t.prototype.fillCombo=function(){var e=this;if(console.log(this.init_fill),this.init_fill){console.log("fillcombolist");var t=new D;t.sql=this.sql,t.types=this.types,t.values=this.values,this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data,e.resetValue(),e.setByValue(e.valDef),"-1"==e.getValue()&&"-1"!=e.valDef&&e.setByDescri(e.valDef),e.fillend.emit())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+e.sql+"]"})}},t.prototype.setByDescri=function(t){if(console.log("setByDescri "+t),null!=(this.valDef=t)&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){var e=t.split(",");console.log("arr_val "+e.length);for(var i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].descrizione_valore==e[n]&&(this.myData[i].checked=!0)}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.setByValue=function(t){if(null!=(this.valDef=t)&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(","),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.getDescri=function(){for(var t="",e=0;e<this.myData.length;e++)console.log(this.myData[e].checked);for(e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=","),t+=this.myData[e].descrizione_valore);return console.log("getDescri: "+t),t},t.prototype.getObjects=function(){for(var t=new Array,e=0;e<this.myData.length;e++)this.myData[e].checked&&t.push(this.myData[e]);return t},t.prototype.getValue=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=","),t+=this.myData[e].valore);return t},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],n.checked=!1,this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){this.selchange.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHList",template:'\n\n\n<div style="width:100%;">\n<section class="bs">\n <table>\n <tr><th></th><th>\n {{label}}\n\n </th></tr>\n <tbody>\n\n <tr *ngFor="let u of myData" class="selector">\n <td style="width:20px"> <mat-slide-toggle (change)="upd_f(u,$event)" [disabled]="!enabled" [(ngModel)]="u.checked"></mat-slide-toggle></td>\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table></section>\n</div>\n\n\n',styles:["\n\n\n"]}]}],t.ctorParameters=function(){return[{type:Y}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}]},t}(),ct=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label=""}return t.prototype.set_selection=function(t,e){this.label=t;for(var i=0;i<e.length;i++)this.cmb_sel.add_option(e[i])},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObj()):this.toastr.error("Selezionare un valore")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\nSELEZIONA {{label|uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px"> \n<FHComboBox #cmb_sel [init_fill]="false" ></FHComboBox>\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),ut=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t.decorators=[{type:l.Pipe,args:[{name:"replaceLineBreaks"}]}],t}(),ht=function(){function t(){this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new l.EventEmitter,this.myDatePickerOptions={width:"150px",dateFormat:"dd/mm/yyyy",dayLabels:{su:"Dom",mo:"Lun",tu:"Mar",we:"Mer",th:"Gio",fr:"Ven",sa:"Sab"},monthLabels:{1:"Gen",2:"Feb",3:"Mar",4:"Apr",5:"Mag",6:"Giu",7:"Lug",8:"Ago",9:"Set",10:"Ott",11:"Nov",12:"Dic"}},this.date_sel=null}return t.prototype.setFocus=function(){console.log("set focus"),this.dtc.setFocusToInputBox()},t.prototype.dt_ch=function(){var t=this;console.log("dt_ch!!"),console.log(this.dtc),setTimeout(function(){console.log(t.date_sel),t.change.emit()},50)},t.prototype.add_year=function(){this.date_sel={date:{year:this.date_sel.date.year+1,month:this.date_sel.date.month,day:this.date_sel.date.day}},this.change.emit()},t.prototype.ini_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:1,day:1}},this.change.emit()},t.prototype.fin_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:12,day:31}},this.change.emit()},t.prototype.getValue=function(){return null==this.date_sel?null:new Date(this.date_sel.date.year,this.date_sel.date.month-1,this.date_sel.date.day)},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.getCopyOfOptions=function(){return JSON.parse(JSON.stringify(this.myDatePickerOptions))},t.prototype.setLimits=function(){var t=this.getCopyOfOptions();null!=this.min_date&&(this.min_date.setDate(this.min_date.getDate()-1),t.disableUntil={year:this.min_date.getFullYear(),month:this.min_date.getMonth()+1,day:this.min_date.getDate()}),null!=this.max_date&&(this.max_date.setDate(this.max_date.getDate()+1),t.disableSince={year:this.max_date.getFullYear(),month:this.max_date.getMonth()+1,day:this.max_date.getDate()}),this.myDatePickerOptions=t},t.prototype.setToday=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:(new Date).getMonth()+1,day:(new Date).getDate()}}},t.prototype.setValue=function(t){this.date_sel=null!=t?{date:{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}}:null},t.decorators=[{type:l.Component,args:[{selector:"DtPicker",template:'\n<div [hidden]="!show_buttons||!enabled"><button mat-raised-button (click)="add_year()">+1 Anno</button>\n<button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n<button mat-raised-button (click)="fin_year()">Fine Anno</button>\n</div>\n\n<div class="lb_small_grigia">{{label}}</div>\n<my-date-picker (dateChanged)="dt_ch()" #appdt [options]="myDatePickerOptions" *ngIf="enabled" [(ngModel)]="date_sel"></my-date-picker>\n\n<div *ngIf="!enabled" class="label_dis" >{{this.date_sel?.date.day}}/{{this.date_sel?.date.month}}/{{this.date_sel?.date.year}}</div>\n',styles:["\n .lb_small_grigia{\n font-size: 12px;\n color: #B8B8B8;\n}\n .label_dis{\n font-size: 14px;\n font-weight: bold;\n}\n"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],dtc:[{type:l.ViewChild,args:["appdt"]}]},t}(),dt=function(){function t(t,e,i){this.dialogRef=t,this._dataService=e,this.toastr=i,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.value_list=new Array,this.value_list_all=new Array,this.value_list_sel=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.types=[],this.values=[],this.value_sel=new Array}return t.prototype.ngOnInit=function(){},t.prototype.filtra=function(){if(this.value_list_sel=new Array,""==this.fltr_user){for(var t=0;t<this.value_list_all.length;t++)if(this.value_list_sel.push(this.value_list_all[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_list_all.length;t++)if(-1!=this.value_list_all[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())){for(var e=!1,i=0;i<this.value_list_sel.length;i++)if(this.value_list_sel[i].descrizione_valore==this.value_list_all[t].descrizione_valore){e=!0;break}if(e||this.value_list_sel.push(this.value_list_all[t]),50==this.value_list_sel.length&&this.limit_size)return}},t.prototype.fill_list=function(t,e){var n=this;this.value_sel=new Array;for(var i=0;i<e.length;i++){var o=new Object;o.descrizione_valore=e[i],this.value_sel.push(o)}var s=new D;s.sql=t,s.types=this.types,s.values=this.values,this._dataService.doQuery(s).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){n.value_list_all=t.result_data,console.log(n.value_list_all);for(var e=0;e<n.value_sel.length;e++)for(var i=n.value_list_all.length-1;0<=i;i--)if(n.value_list_all[i].descrizione_valore==n.value_sel[e].descrizione_valore){n.value_list_all.splice(i,1);break}n.filtra()}},function(t){n.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list_all.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&this.value_list_all.splice(t,1),this.single_sel&&(this.value_sel=new Array),this.value_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra(),this.single_sel&&this.ok()}else this.toastr.error("ERRORE","Selezionare il valore da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.value_sel.indexOf(this.selectedRemove,0);-1<t&&this.value_sel.splice(t,1),this.value_list_all.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare il valore da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return console.log("aa >="+t),t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t.decorators=[{type:l.Component,args:[{selector:"FHPickList",template:'\n <mat-card style="width:600px;">\n <mat-card-content style="width:600px;">\n <div fxLayout="column" fxLayoutGap="15px" fxFlex style="width:600px;height:400px">\n <div fxLayout="row" style="width:550">\n <div fxLayout="column" fxFlex="41%">\n\n <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()" style=\'padding:8px;margin:15px auto;width:100%;\' placeholder=\'Ricerca...\'>\n <div style="width:100%;height:250px;overflow:auto;">\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of value_list_sel" (click)="addTo(u)" (dblclick)="do_add()" class="selector" [ngClass]="{ \'active\': selectedAdd == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div fxLayout="column" fxFlex="18%" style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-raised-button (click)="do_add()" [disabled]="!option"><mat-icon>arrow_forward</mat-icon> </button>\n <br><br>\n <button mat-raised-button (click)="do_rem()" [disabled]="option"> <mat-icon>delete</mat-icon> </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n <div style="text-align: center;">\n <b>Valori Selezionati</b>\n </div>\n\n <div style="width:100%;height:250px;overflow:auto;">\n\n <table class="table table-striped table-hover">\n <tbody>\n <tr *ngFor="let u of value_sel" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector" [ngClass]="{ \'active\': selectedRemove == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br><br>\n<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-raised-button color="primary" (click)="ok()">Ok</button>\n <button mat-raised-button (click)="dialogRef.close()">Annulla</button>\n</div>\n</div>\n </mat-card-content>\n\n</mat-card>\n',styles:["\n .selector:hover{\n background-color:#fafafa;\n cursor:pointer;\n }\n .active{\n background-color:#fafafa;\n cursor:pointer;\n }\n .fabeOut{\n display: block;\n background-color: rgba(0,0,0,.5);\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n\n pointer-events: auto;\n -webkit-transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n }\n .cardFloat{\n\n }\n\n"]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:Y},{type:c.ToastrService}]},t.propDecorators={value_list:[{type:l.Input}],value_list_all:[{type:l.Input}],value_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],limit_size:[{type:l.Input}],value_sel:[{type:l.Input}]},t}(),_t=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.valore_min=1,this.valore_max=1e6}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){Number(this.valore)<this.valore_min||Number(this.valore)>this.valore_max?this.toastr.error("Il valore deve avere essere compreso tra "+this.valore_min+" - "+this.valore_max):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}}" type="number" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button mat-raised-button color="warn" (click)="chiudi()">ANNULLA</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t}(),gt=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.path_md=""}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"FHMdReader",template:'\n <markdown [src]="path_md">\n\n</markdown>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Y},{type:w}]},t.propDecorators={path_md:[{type:l.Input}]},t}(),mt=function(){function t(){}return t.decorators=[{type:l.Component,args:[{selector:"FHLogPanel",template:'\n\n\n <div style="width:100%;">\n <section class="bs">\n\x3c!--\n\n <FHGrid [init_fill]="false" #dtm [show_buttons]="false" [auto_height]="false" [g_height]="g_height" [columnDefs]="columnDefs" tbl_name="logs" grid_key="logs" sort_field="data desc"></FHGrid>\n--\x3e\n\n </section>\n </div>\n\n\n ',styles:["\n\n\n "]}]}],t}(),ft=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars?this.toastr.error("Il valore deve contenere almeno "+this.min_chars+" caratteri"):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="width:600px" >\n <mat-form-field>\n <textarea matInput placeholder="{{label}}" type="text" [(ngModel)]="valore" style="width:600px" rows="15" required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button mat-raised-button color="warn" (click)="chiudi()">ANNULLA</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),vt={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return yt}),multi:!0},yt=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.change=new l.EventEmitter,this.innerValue=0,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout(function(){t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),t.onChange(t.value)},50)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal),this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transformAmount=function(t){var e=this;try{setTimeout(function(){e.value=parseFloat(e.formattedAmount.split(".").join("").split(",").join(".")),e.formattedAmount=e.transform(e.value,e.decimal)},50)}catch(i){console.log(i)}},t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHCurrencyField",providers:[vt],template:'\n <mat-form-field [hidden]="hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event)"\n (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"\n pattern="[0-9]+">\n </mat-form-field>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),bt={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return It}),multi:!0},It=function(){function t(){this.enabled=!0,this.value="",this.height="360",this.change=new l.EventEmitter,this.focus=new l.EventEmitter,this.blur=new l.EventEmitter,this.config=new Object,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onFocus=function(t){this.focus.emit(t)},t.prototype.onBlur=function(t){this.blur.emit(t)},t.prototype.ngOnInit=function(){this.config={height:this.height},console.log("this.enabled"),console.log(this.enabled),this.enabled?(console.log("enabled"+this.enabled),this.config.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}]):(this.config.allowedContent=!0,this.config.toolbarGroups=[])},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.decorators=[{type:l.Component,args:[{selector:"FHRichText",providers:[bt],template:'\n <ckeditor #ced\n [(ngModel)]="value"\n [config]="config"\n [readonly]="!enabled"\n (change)="writeValue($event)"\n (focus)="onFocus($event)"\n (blur)="onBlur($event)" ngDefaultControl\n debounce="500">\n </ckeditor>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={enabled:[{type:l.Input}],value:[{type:l.Input}],height:[{type:l.Input}],change:[{type:l.Output}],focus:[{type:l.Output}],blur:[{type:l.Output}],ced:[{type:l.ViewChild,args:["ced"]}]},t}(),St=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_output",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <textarea matInput >{{valore}}</textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n\n\n ',styles:[]}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Et={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Ot}),multi:!0},Ot=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.change=new l.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){""!=this.formattedAmount?this.value=this.uti_s.round(parseFloat(this.formattedAmount.split(".").join("").split(",").join(".")),this.decimal):this.value=this.uti_s.round(0,this.decimal),this.formattedAmount=this.transform(this.value,this.decimal),this.chgf=!0,this.onChange(this.value)},t.prototype.writeValue=function(t){this.chgf?this.chgf=!1:(console.log("writeValue "+t+" "+this.decimal),null==t&&(t=0),t!==this.innerValue&&(this.innerValue=t,this.value=t,console.log("prima "+this.formattedAmount),this.formattedAmount=this.transform(this.value,this.decimal),console.log("dopo "+this.formattedAmount)))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transform=function(t,e){void 0===e&&(e=0),console.log("transform "+t+" "+e);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),console.log(n+s),n+s},t.prototype.removeCurrencyPipeFormat=function(t){console.log("removeCurrencyPipeFormat "+this.value);try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),console.log("tttttttttttt",this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHNumericField",providers:[Et],template:'\n <mat-form-field [hidden]="hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="chg()"\n (focus)="removeCurrencyPipeFormat($event)"\n pattern="[0-9]+">\n </mat-form-field>\n\n',styles:["\n\n"]}]}],t.ctorParameters=function(){return[{type:P}]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),Rt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.sql=""}return t.prototype.doFill=function(){this.cmb_sel.sql=this.sql,this.cmb_sel.types=this.types,this.cmb_sel.values=this.values,this.cmb_sel.fillCombo()},t.prototype.ok=function(){""!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObjects()):this.toastr.error("Selezionare un valore")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\n {{label|uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <FHList #cmb_sel [label]="" style="width:100%;min-height:90px" init_fill="false" ></FHList>\n\n </mat-dialog-content>\n\n\n<mat-dialog-actions>\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</mat-dialog-actions>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:c.ToastrService},{type:R}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),wt={provide:u.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Ct}),multi:!0},Ct=function(){function t(t,e,i){this.dataservice=t,this.dialog=e,this.toast=i,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.change=new l.EventEmitter,this.select=new l.EventEmitter,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this.required&&(this.label=this.label+" *")},Object.defineProperty(t.prototype,"userName",{get:function(){return this.selectedUser?this.selectedUser.cognome+" "+this.selectedUser.nome:""},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){console.log("writevalue "+t),null!=t&&""!=t&&("noop"!=t?null!=this.selectedUser?this.selectedUser.username!=t&&this.setByUsername(t):this.setByUsername(t):this.onChange(this.selectedUser.username))},t.prototype.setByUsername=function(t){var e=this;if(t){var i={sql:"SELECT_USER_BY_USERNAME",types:["string"],values:[t],names:[]};this.dataservice.doQuery(i).subscribe(function(t){console.log(t),t.result_data.length<1?e.clear():(e.selectedUser=t.result_data[0],e.onChange(e.selectedUser.username),e.change.emit(e.selectedUser))})}},t.prototype.setById=function(t){var e=this;if(t){var i={sql:"SELECT_USER_BY_ID",types:["string"],values:[t],names:[]};this.dataservice.doQuery(i).subscribe(function(t){console.log(t),t.result_data.length<1?e.clear():(e.selectedUser=t.result_data[0],e.onChange(e.selectedUser.username),e.change.emit(e.selectedUser))})}},t.prototype.open_pick=function(){var e=this,t=this.dialog.open(dt,{disableClose:!0});t.componentInstance.fill_list("SELECT_ALL_USERS",[]),t.componentInstance.single_sel=!0,t.afterClosed().subscribe(function(t){null!=t&&(e.clear(),0<t.length&&(e.selectedUser=t[0],e.writeValue("noop"),e.select.emit(e.selectedUser)))})},t.prototype.clear=function(){this.selectedUser=null,this.onChange(null),this.change.emit(this.selectedUser),this.select.emit(this.selectedUser)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.decorators=[{type:l.Component,args:[{selector:"FHUserField",providers:[wt],template:'\n <mat-form-field>\n <button class="clickable-field" (click)="open_pick()">\n <input matInput\n [hidden]="hidden"\n [placeholder]="label"\n type="text"\n [ngModel]="userName"\n disabled></button>\n <button mat-icon-button\tmatSuffix\n [hidden]="!selectedUser"\n (click)="clear()"><mat-icon>clear</mat-icon></button>\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n text-align: left;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}]}],t.ctorParameters=function(){return[{type:Y},{type:o.MatDialog},{type:c.ToastrService}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],select:[{type:l.Output}]},t}(),At=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i}return t.prototype.salva_esci=function(){this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n\n<br>\n<div style="width:100%;text-align:center;">\n<button mat-raised-button color="primary" (click)="salva_esci()">SALVA ED ESCI</button>\n <button mat-raised-button color="warn" (click)="esci_senza_salv()">ESCI SENZA SALVATAGGIO</button>\n\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t}(),Nt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.lbl="",this.nota="",this.nota_commento="",this.title="ASSEGNA DOCUMENTO",this.comm_notrequired=!0,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.arrAutori=this.m_appService.getState().wkf_doc_info.arrAutori;for(var o=0;o<this.arrAutori.length;o++)null==this.arrAutori[o].username&&(this.arrAutori[o].username=this.arrAutori[o].idp);this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)")}return t.prototype.ok=function(){if(this.comm_notrequired||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n<div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false" ></FHPickUsers>\n</div><br><br><br>\n\n <textarea matInput placeholder="Commento {{nota_commento}}" [(ngModel)]="nota" rows="6"></textarea>\n\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Dt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.utenti="",this.lbl="",this.nota="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=!0,this.mobile=!1,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.utenti=this.m_appService.getState().wkf_doc_info.utenti,console.log("this.comm_notrequired"),console.log(this.comm_notrequired),this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("abort")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>\n <div style="font-size:10px" *ngIf="mobile">{{lbl}}</div>\n <div *ngIf="!mobile">{{lbl}}</div>\n\n\n </mat-toolbar>\n <br>\n<div mat-dialog-content style="min-width:800px">\n<div *ngIf="mobile" style="font-size:10px">Assegnata a: {{utenti}}</div>\n <h3 *ngIf="!mobile">Assegnata a: {{utenti}}</h3>\n <br>\n <mat-form-field>\n <textarea matInput placeholder="Commento {{nota_commento}}" [(ngModel)]="nota" rows="6"></textarea>\n</mat-form-field>\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t}(),kt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar>SELEZIONA AMBITO<div style="width:100%;text-align: right;">\n\n\n </div>\n\n </mat-toolbar>\n<div mat-dialog-content><br><br>\n <mat-select placeholder="Seleziona Ambito:" #cmb [(ngModel)]="selval" style="width:100%">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app}}" *ngFor="let app of myData">{{app}}</mat-option>\n </mat-select>\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">OK</button>\n</div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Tt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",console.log("this.setStepCombo"),this.setStepCombo(this.m_appService.getState().wkf_doc_info.livs,this.m_appService.getState().wkf_doc_info.st,this.m_appService.getState().wkf_doc_info.cl)}return t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t,e,i){for(var n=e.split("|"),o=new Array,s=0;s<n.length;s++)for(var r=0;r<t.length;r++){if("*N"==n[s].toString().toUpperCase()){(a={descri_livello:"Prosegui a step successivo"}).g=0==s?1:0,a.livello="*N",o.push(a);break}if("*C"==n[s].toString().toUpperCase()){var a;(a={descri_livello:"Prosegui a chiusura"}).g=0==s?1:0,a.livello="*C",o.push(a);break}if(n[s]==t[r].livello&&n[s]!=i.livello){t[r].g=0==s?1:0,o.push(t[r]);break}}1==o.length&&this.dialogRef.close(o[0].livello),this.myData=o},t.prototype.ok=function(){null!=this.selval&&"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE LO STEP SUCCESSIVO",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar style="max-width:500px">SELEZIONA PROSSIMO STEP:\n\n </mat-toolbar>\n<mat-dialog-content style="max-width:500px"><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Prossimo Step:" #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n\n\n\n<br><br><br><br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">{{OK_BUTTON}}</button>\n <button mat-raised-button (click)="this.dialogRef.close()">ANNULLA</button>\n</div><br><br>\n</mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Mt=function(){function t(t,e,i,n,o,s){var r=this;this.dialogRef=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.uti_s=s,this.enabled=!0,this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.b_False=!1,this.title="ALLEGATI",this.b_ini=!1,this.single=!0,this.label_b="",this.descrizione="",this.file_name="",this.label="Descrizione Allegato",this.username="",this.uploader=new d.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT}),this.username=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(r.descrizione="",r.toastr.info("INFO","ALLEGATO INSERITO",{timeOut:1e3,progressBar:!0}),r.ref_allegato(),r.change.emit())}}return t.prototype.download_all=function(t){console.log(t),null!=t.App&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename),null!=t.APP&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.APP+"/"+t.K+"/"+t.Filename)},t.prototype["delete"]=function(i){var n=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(q).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="DELETE_ALLEGATO",e.types=["int"],e.values=[i.id],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.arr_g=t.result_data,n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))},function(t){})}})},t.prototype.ch=function(){var i=this;this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",""),e.append("local_path",i.app_s.LOCAL_PATH)};var t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],this.uploader.setOptions(t),this.uploader.uploadAll()},t.prototype.ref_allegato=function(){var e=this;if(null!=this.App&&""!=this.App){var t=new D;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.arr_g=t.result_data)},function(t){})}},t.prototype.ngOnInit=function(){this.App=this.app_s.getState().wkf_doc_info.uiid_app,this.K=this.app_s.getState().wkf_doc_info.uiid_doc,this.single=!1,this.init(this.App,this.K),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ref_allegato()},t.decorators=[{type:l.Component,args:[{selector:"wkf_win_upload",template:' <mat-toolbar color="primary">{{title}} <div style="width:100%;text-align: right;">\n </div>\n\n </mat-toolbar>\n <div mat-dialog-content style="min-width:800px">\n <br>\n <div *ngIf="enabled">\n\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}}">\n\n\n <input type="file" ng2FileSelect [uploader]="uploader" multiple (change)="ch()" />\n \x3c!--<button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>--\x3e\n </div>\n <br>\n\n\n\n\n <br>\n <section class="bs">\n <table class="table table-hover table-bordered table-striped table-card">\n <thead>\n <tr>\n <th style="width:25%;">Nome</th>\n <th style="width:15%;">Dim.</th>\n <th style="width:35%;">Descrizione</th>\n <th style="width:15%;">Data</th>\n <th style="width:15%;"></th>\n <th n *ngIf="enabled" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of arr_g">\n <td>{{app.Filename}}</td>\n <td>{{app.Filesize}}</td>\n <td>{{app.descrizione}}</td>\n <td>{{app.dt_ins | date: \'dd/MM/yyyy hh:mm:ss\'}}</td>\n <td> <button (click)="download_all(app)" mat-raised-button >DOWNLOAD</button></td>\n <td><a mat-icon-button *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n </tr>\n </table>\n </section>\n\n\n</div>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'Option 1\')">CHIUDI</button>\n</div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:Y},{type:c.ToastrService},{type:o.MatDialog},{type:R},{type:P}]},t.propDecorators={enabled:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}],single:[{type:l.Input}]},t}(),xt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.user_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close(null)},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n<div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false" ></FHPickUsers>\n</div><br>\n\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Pt=function(){function t(t,e){this.http=t,this.app_s=e,this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT,this.headers=new a.Headers,this.headers.append("Content-Type","application/json"),this.headers.append("Authorization","Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token"))}return t.prototype.doQuery=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT;var e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),i.Observable["throw"](e)},t.prototype.downloadfile=function(t){return(new a.Headers).append("responseType","arraybuffer"),this.http.get(t).map(function(t){return new Blob([t],{type:"application/octect"})})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:a.Http},{type:R}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(a.Http),l.inject(R))},token:t,providedIn:"root"}),t}(),Lt=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,console.log(t),this.nota=t.commento,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var n=this,t=new D;t.sql="SELECT_COMMENTI_DOCUMENTO",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){n.commenti_list=t.result_data;for(var i=0;i<n.commenti_list.length;i++)n.commenti_list[i].v_commento="<b>"+n.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";e=!0}e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var n=this,t=new D;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(xt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){var c=this;void 0===p&&(p=!0);var u=new D;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(u).subscribe(function(t){},function(t){c.toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new D).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new D).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngOnInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n <button color="primary" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>INSERISCI\n</button>\n\n </mat-toolbar>\n <br>\n<div mat-dialog-content style="min-width:800px">\n\n <textarea matInput placeholder="Commento" *ngIf="b_edit" [(ngModel)]="nota" rows="12"></textarea>\n\n <div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table class="table table-hover table-bordered table-striped table-card">\n <tr>\n <th>Commento</th>\n <th>Autore</th>\n <th>Data</th>\n <th></th>\n </tr>\n <tbody>\n <ng-template ngFor let-app [ngForOf]="commenti_list" let-i="index">\n <tr>\n\n <td [innerHTML]="app.v_commento"></td>\n <td>{{app.COGNOME+\' \'+app.NOME}}</td>\n <td>{{app.v_data_creazione}}</td>\n <td><mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user" (click)="edit_comm(app)">edit</mat-icon></td>\n </tr>\n </ng-template>\n </tbody>\n </table>\n </section>\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:o.MatDialog},{type:R},{type:c.ToastrService},{type:Y},{type:Pt}]},t}(),Ft=function(){function t(t,e){this.dialogRef=t,this.m_appService=e,this.hide_richiedente=!1,this.codice=this.m_appService.getState().wkf_doc_info.codice,this.data_richiesta=this.m_appService.getState().wkf_doc_info.data_richiesta,this.richiedente=this.m_appService.getState().wkf_doc_info.richiedente,this.stato=this.m_appService.getState().wkf_doc_info.stato,this.in_carico_a=this.m_appService.getState().wkf_doc_info.in_carico_a,this.uiid_app=this.m_appService.getState().wkf_doc_info.uiid_app,this.uiid_doc=this.m_appService.getState().wkf_doc_info.uiid_doc}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar color="primary">INFO DOCUMENTO <div style="width:100%;text-align: right;">\n\n\n </div>\n\n\n </mat-toolbar>\n<div mat-dialog-content>\n <section class="bs">\n <table class="table">\n\n <tbody>\n <tr>\n\n <td>Codice:</td>\n <td><b>{{codice}}</b></td>\n </tr>\n <tr>\n\n <td>Data:</td>\n <td><b>{{data_richiesta | date: \'dd/MM/yyyy hh:mm:ss\'}}</b></td>\n </tr>\n <tr *ngIf="!hide_richiedente">\n\n <td>Richiedente:</td>\n <td><b>{{richiedente}}</b></td>\n\n </tr>\n <tr>\n\n <td>Stato:</td>\n <td><b>{{stato}}</b></td>\n\n </tr>\n <tr>\n\n <td>In Carico a:</td>\n <td><b>{{in_carico_a}}</b></td>\n\n </tr>\n\n <tr>\n\n <td>Uiid App:</td>\n <td><b>{{uiid_app}}</b></td>\n\n </tr>\n <tr>\n\n <td>Uiid Doc:</td>\n <td><b>{{uiid_doc}}</b></td>\n\n </tr>\n </tbody>\n </table>\n </section>\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R}]},t}(),jt=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.logs=new Array,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.not_int=!0,this.subject="",this.link="",this.codice_doc=""}return t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="LOG WORKFLOW E COMMENTI"},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.prototype.ngOnInit=function(){this.refresh_list()},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,console.log(t),this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var i=this,t=new D;t.sql="SELECT_WORKFLOW_LOG",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.logs=t.result_data,e=!0),e||i.toastr.error("ERRORE",t.msg)},function(t){i.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var n=this,t=new D;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(xt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){var c=this;void 0===p&&(p=!0);var u=new D;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(u).subscribe(function(t){},function(t){c.toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new D).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new D).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar color="primary">{{title}}<div style="width:100%;text-align: right;">\n\n</div>\n<button color="primary" (click)="ins()" *ngIf="!b_edit">\n<mat-icon>note_add</mat-icon>INSERISCI\n</button>\n\n</mat-toolbar>\n\n<div mat-dialog-content>\n<section class="bs" *ngIf="b_edit">\n<br><br>\n<textarea matInput placeholder="Commento" *ngIf="b_edit" [(ngModel)]="nota" style="min-width:400px" rows="12"></textarea>\n\n<div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n</div>\n<br><br>\n</section>\n<section class="bs" *ngIf="!b_edit">\n<table class="table">\n\n<tbody>\n <tr>\n <th>Data</th>\n <th>Utente</th>\n <th>Operazione</th>\n <th>Stato Attuale</th>\n <td></td>\n </tr>\n <tbody>\n <ng-template ngFor let-app [ngForOf]="logs" let-i="index">\n<tr>\n<td>{{app.v_data_creazione}}</td>\n<td>{{app.nc}}</td>\n<td>{{app.operazione}}</td>\n<td>{{app.stato_attuale}}</td>\n<td><mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user" (click)="edit_comm(app)">edit</mat-icon></td>\n</tr>\n </ng-template>\n</tbody>\n</table>\n</section>\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;" *ngIf="!b_edit">\n<button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:o.MatDialog},{type:R},{type:c.ToastrService},{type:Y},{type:Pt}]},t}(),zt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.edit=function(t){var e=this,i=new D;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info("Documento "+e.datagrid.sRow.codice+" Recuperato"),e.dialogRef.close("ok"))},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:"Codice",field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Oggetto",field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Stato",field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Richiedente",field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n<div mat-dialog-content style="min-width:800px">\n<FHGrid [filters]="flt_grid" init_fill="false" show_buttons="false" vis #dtm (dclicked)="edit($event)" g_width="100%" g_height="100%" tbl_name="wkf_documents" grid_key="r_wkf_documents" sort_field="codice desc" off_set="50" fields="*"></FHGrid>\n\n\n</div>\n<br>\n\n<div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n</div>\n\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={datagrid:[{type:l.ViewChild,args:["dtm"]}]},t}(),Ut=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].livello+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})}else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:' <mat-toolbar>{{title}}\n\n </mat-toolbar>\n<mat-dialog-content><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Step:" #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n\n\n\n<br><br><br><br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()">{{OK_BUTTON}}</button> \n <button mat-raised-button color="warn" (click)="this.dialogRef.close()">ANNULLA</button>\n</div><br><br>\n</mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Yt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n<div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false" [single_sel]="commento_hidden" ></FHPickUsers>\n</div><br><br><br>\n\n <textarea matInput placeholder="Commento {{nota_commento}}" [hidden]="commento_hidden" [(ngModel)]="nota" rows="6"></textarea>\n\n\n\n\n\n\n</div>\n<br>\n<div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button>\n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n</div>\n\n'}]}],t.ctorParameters=function(){return[{type:o.MatDialogRef},{type:R},{type:c.ToastrService},{type:Y}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Kt=function(){function t(t,e,i,n,o,s,r){this._dataService=t,this.http=e,this.router=i,this.route=n,this._fileService=o,this.app_s=s,this.uti_s=r,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new a.Headers,this.headers.append("Content-Type","application/json")}return t.prototype.logout=function(){localStorage.removeItem(this.app_s.COMPANY_KEY+"user"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_idp"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_password"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_roles"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_lang"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_isadmin"),localStorage.removeItem(this.app_s.COMPANY_KEY+"token"),1!=this.app_s.LOGIN_EXT?this.router.navigate(["login"]):window.location.href=this.app_s.LOGOUT_URL_EXT},t.prototype.login=function(t,e){this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var i=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(i=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,i,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.get_user_info=function(t){this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var e=JSON.stringify({username_info:t});return this.http.post(this.url,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.login_sa=function(){var n=this;if(console.log("login"),!this.checkCredentials()){for(var t=window.location.href.split(/[\&?]+/),e=!1,i=0;i<t.length;i++)if("u="==t[i].substring(0,2)){var o=t[i].split("=")[1];this.username=this.uti_s.decrypt(decodeURI(o)),e=!0}else t[i];if(e)this.get_user_info(this.username).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;n.username="NA",0<i.length?(n.username=i[0].username,console.log("scrivo username: "+i[0].username),console.log(i[0]),localStorage.setItem(n.app_s.COMPANY_KEY+"user_name",i[0].name),localStorage.setItem(n.app_s.COMPANY_KEY+"user_surname",i[0].surname),localStorage.setItem(n.app_s.COMPANY_KEY+"user",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_email",i[0].email),localStorage.setItem(n.app_s.COMPANY_KEY+"user_password",""),localStorage.setItem(n.app_s.COMPANY_KEY+"user_idp",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_lang","IT"),localStorage.setItem(n.app_s.COMPANY_KEY+"user_isadmin",i[0].isadmin),localStorage.setItem(n.app_s.COMPANY_KEY+"user_roles",i[0].roles),localStorage.setItem(n.app_s.COMPANY_KEY+"token","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJlZm9ybmkiLCJpc3MiOiJ3d3cuZmx1eGh1Yi5jb20iLCJyb2xlIjoib2tfbG9nZ2VkIiwiaWF0IjoxNTA3OTA3MzQ2fQ.xqXZsPTu8stomoIl8_2d9DhLkGU3gAi7MXwClYNkEzg"),e=!0):localStorage.removeItem("token")}e||console.log(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")});else{console.log("login");var s=encodeURI(window.location.href).replace("#","%23");-1==s.indexOf("?")&&(s+="?"),this.url="http://csaportale.ceramicasantagostino.it/homepage_new.nsf/OK?OpenForm&redirect="+s,console.log(this.url),window.location.href=this.url}}},t.prototype.passrecovery=function(t){var e=JSON.stringify({email:t,websiteroot:this.app_s.COMPANY_SITE_ROOT,op:"send_email"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.checktoken=function(t){var e=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,e,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.change_password=function(t,e){var i=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,i,{headers:this.headers}).map(this.extractData)["catch"](this.handleError)},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return i.Observable["throw"](e)},t.prototype.checkCredentials_toLogin=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")||(1==this.app_s.LOGIN_EXT?this.login_sa():-1==this.router.url.indexOf("/rp/")&&this.router.navigate(["login"]),!1)},t.prototype.checkCredentials=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:Y},{type:a.Http},{type:f.Router},{type:f.ActivatedRoute},{type:C},{type:R},{type:P}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(Y),l.inject(a.Http),l.inject(f.Router),l.inject(f.ActivatedRoute),l.inject(C),l.inject(R),l.inject(P))},token:t,providedIn:"root"}),t}(),Vt=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),qt=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[R,Y,A,C,w,Pt,Q,Kt,P]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:l.NgModule,args:[{imports:[E.MyDatePickerModule,d.FileUploadModule,S.AgGridModule.withComponents([L,F]),I.CommonModule,u.FormsModule,M,O.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),v.FlexLayoutModule,y.MarkdownModule,b.CKEditorModule],declarations:[j,z,U,K,V,B,G,$,X,q,tt,et,F,L,it,nt,st,ot,rt,W,at,lt,pt,ct,ut,ht,J,dt,_t,gt,mt,ft,yt,It,St,Ot,Rt,H,Ct,T,Vt,Z,k,D,N,At,Nt,Dt,kt,Tt,Mt,Lt,Ft,jt,zt,Ut,Yt,xt],exports:[j,z,U,K,V,B,G,$,X,q,tt,et,F,L,it,nt,st,ot,rt,W,at,lt,pt,ct,ut,ht,J,dt,_t,gt,mt,ft,yt,It,St,Ot,Rt,H,Ct,T,Vt,Z,k,D,N],providers:[],entryComponents:[At,Nt,Dt,kt,Tt,Mt,Lt,Ft,jt,zt,Ut,Yt,xt,dt,q,z,it,nt,rt,W,at,lt,ct,J,_t,ft,St,Rt,H]}]}],t}(),Bt=function(){function t(t,e,i,n,o,s,r,a){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.appService=s,this.slimLoadingBarService=r,this.app_s=a,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.routingDestination="",this.arr_accessi=null}return t.prototype.canActivate=function(t,e){var n=this;return this.routingDestination=t.url[0].path,console.log(this.routingDestination),""==this.routingDestination||("login"==this.routingDestination||"rp"==this.routingDestination||"pr"==this.routingDestination||"/"==this.routingDestination||(this.auth.checkCredentials()?"home"==this.routingDestination||(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")&&"1"==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||new Promise(function(i){if(null!=n.arr_accessi){for(var t=0;t<n.arr_accessi.length;t++)if("M"==n.arr_accessi[t].type&&"["+n.arr_accessi[t].url.split("/").join("")+"]"=="["+n.routingDestination.split("/").join("")+"]")return console.log(typeof r.Observable.of(!0)),console.log("OBS3 "+!0),void i(!0);return n.toast.error("ACCESS DENIED"),n.slimLoadingBarService.complete(),void i(!1)}var e=new D;e.sql="SELECT_APPS_USER",n.appService.getState().app_enabled=new Array,e.types=["string"],e.values=[localStorage.getItem(n.app_s.COMPANY_KEY+"user")],n.querys.doQuery(e).subscribe(function(t){n.arr_accessi=t.result_data;for(var e=0;e<n.arr_accessi.length;e++)if("M"==n.arr_accessi[e].type&&"["+n.arr_accessi[e].url.split("/").join("")+"]"=="["+n.routingDestination.split("/").join("")+"]")return console.log(typeof r.Observable.of(!0)),console.log("OBS3 "+!0),void i(!0);n.toast.error("ACCESS DENIED"),i(!1),n.slimLoadingBarService.complete()})})):(this.toast.error("ACCESS DENIED"),this.slimLoadingBarService.complete(),!1)))},t.decorators=[{type:l.Injectable}],t.ctorParameters=function(){return[{type:a.Http},{type:Kt},{type:f.Router},{type:c.ToastrService},{type:Y},{type:R},{type:_.SlimLoadingBarService},{type:R}]},t}(),Ht=function Jt(t,e,i){this.year=t,this.month=e,this.day=i},Gt=function(){function t(t){this.app_s=t}return t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(undefined);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),0<(t||"").toString().indexOf(",")&&(t=(t||"").toString().split(".").join("").split(",").join("."));var s=x((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=0<e?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e){if(10!=t.length)return null;var i=t.split("-");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]))}if(2==e&&19<=t.length){i=(o=(t=t.substring(0,19)).split("T"))[0].split("-");var n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}if(3==e&&16<=t.length){var o;i=(o=(t=t.substring(0,16)).split(" "))[0].split("/"),n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),0)}return null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.DateAdd=function(t,e,i){var n,o=i.valueOf();switch(t){case"ms":n=new Date(o+1*e);break;case"s":n=new Date(o+1e3*e);break;case"mi":n=new Date(o+6e4*e);break;case"h":n=new Date(o+36e5*e);break;case"d":n=new Date(o+864e5*e);break;case"y":n=new Date(o+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()," ",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=x((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i,"T",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,r,a,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",r=void 0===n?",":n,(t<0?"-":"")+((l=3<(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)?l%3:0)?a.substr(0,l)+r:"")+a.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+r)+(o?s+Math.abs(t-a).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);console.log(n+" "+String.fromCharCode(n)),e+=String.fromCharCode(n)}return e},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles")&&(!(!e||null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin"))||-1<localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles").toUpperCase().indexOf(t.toLocaleUpperCase()))},t}(),Qt=function(){function t(t,e,i,n,o,s,r,a){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_fservice=n,this.m_router=o,this._toastr=s,this.dialog=r,this.m_wkf=a,this.b_editing=!1,this.is_Supervisor=!1,this.is_Admin=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.imp="",this.sort_field="",e.checkCredentials()&&(this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc")}return t.prototype.goto_edit_doc=function(t,e){console.log("App"+this.app_root+" a "+t+" d "+e),this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.annulla_richiesta=function(){var i=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi di voler annullare il documento numero: "+this.get_grid().sRow.codice+"?"),this.dialog.open(q,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new D;e.sql="UPDATE_WKF_ANNULATO",e.types=["string","string","int"],e.values=[i.id_applicativo,i.get_grid().sRow.uiid,-1],i.m_dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}})):this._toastr.error("Selezionare il documento da annullare")},t.prototype.recupera_richiesta=function(){var e=this,t=this.dialog.open(zt,{disableClose:!0});t.componentInstance.init_w(this.id_applicativo),t.afterClosed().subscribe(function(t){"ok"==t&&e.get_grid().doFill("")})},t.prototype.riassegna_richiesta=function(){var s=this;if(null!=this.get_grid().sRow){var t=new D;t.sql="SELECT_WLIVELLIV2ADM",t.types=["string","string","string"],t.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato],this.m_dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){s.livs_adm=t.result_data;for(var e=new Array,i="",n=0;n<s.livs_adm.length;n++)-1==i.indexOf(String(s.livs_adm[n].livello))&&(i=i+String(s.livs_adm[n].livello)+"|",e.push(s.livs_adm[n]));var o=s.dialog.open(Ut,{disableClose:!0});o.componentInstance.setStepCombo(e),o.componentInstance.title="Riassegnazione documento: "+s.get_grid().sRow.codice+" - "+s.get_grid().sRow.oggetto,o.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(console.log(t),s.os_r=t.lvl_sel,s.riassegna_richiesta_step1())})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var e=this,t=new Array,i=0;i<this.livs_adm.length;i++)this.livs_adm[i].livello==this.os_r.livello&&0==this.livs_adm[i].notifica&&t.push(this.livs_adm[i]);var n=this.dialog.open(Yt,{disableClose:!0});for(i=0;i<t.length;i++)t[i].nc=t[i].nc.split(" ()").join(""),null!=t[i].idp&&null==t[i].username&&(t[i].username=t[i].idp);console.log(t),n.componentInstance.arrAutori=t,n.componentInstance.title="Riassegnazione documento: "+this.get_grid().sRow.codice+" - "+this.get_grid().sRow.oggetto,n.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(e.wax=t.arrsel,e.nota_wax=t.nota,e.riassegna_richiesta_step2())})},t.prototype.riassegna_richiesta_step2=function(){var e=this,t="";null!=this.get_grid().sRow.lettori&&(t=this.get_grid().sRow.lettori);var i,n="",o="",s="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);for(var a="",l=0;l<this.wax.length;l++)""!=a&&(a+=","),a+=this.wax[l].idp,-1==t.indexOf(this.wax[l].idp)&&(""!=t&&(t+=","),t+=this.wax[l].idp),-1==o.indexOf(this.wax[l].nc)&&(""!=o&&(o+=","),o+=this.wax[l].nc),""!=s&&(s+=","),s+=this.wax[l].nc,null!=r&&-1==r.indexOf(this.wax[l].idp)&&(""!=r&&(r+=","),r+=this.wax[l].idp),""!=n&&(n+=","),n+=this.wax[l].idp;(this.sendEMail_ex(this.user_idp,a,this.titolo_email+"L'utente "+this.user_cognome+" "+this.user_nome+" ti ha riassegnato il documento: "+this.get_grid().sRow.codice,"Commento:\n\n"+this.nota_wax,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax),(i=new D).sql="INSERT_COMMENTO_RIASS",i.types=["string","string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+s,this.user_idp,this.os_r.descri_livello],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new D).sql="UPDATE_RIASS_DOCUMENTO",i.types=["string","string","string","string","string","string","string","string","string"],i.values=[this.os_r.livello,this.os_r.descri_livello,t,n,this.os_r.descri_livello,o,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&e.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new D).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),0<this.wax.length)&&((i=new D).sql="UPDATE_RIASSEGNA_TODO",i.types=["string","string"],i.values=[this.wax[0].idp,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l){var p=this,c=new D;c.sql="send_wkf_mail",c.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(c).subscribe(function(t){},function(t){p._toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.annulla_imp=function(){localStorage.setItem(this.app_s.COMPANY_KEY+"user_name",localStorage.getItem(this.app_s.COMPANY_KEY+"user_name_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user",localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_surname",localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_email",localStorage.getItem(this.app_s.COMPANY_KEY+"user_email_ori")),this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email_ori"),this.imp="",this.get_grid().doFill("")},t.prototype.test_utente=function(){var i=this,n=new D;n.sql="SELECT_UTENTI_WORKFLOW",n.types=["string"],n.values=[this.id_applicativo],this.m_dataService.doQuery(n).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){console.log(t.result_data);var e=i.dialog.open(Yt,{disableClose:!0});e.componentInstance.arrAutori=t.result_data,e.componentInstance.title="Impersona Utente",e.componentInstance.commento_hidden=!0,e.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&((n=new D).sql="SELECT_USER_INFO_WKF",n.types=["string"],n.values=[t.arrsel[0].username],i.m_dataService.doQuery(n).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(localStorage.setItem(i.app_s.COMPANY_KEY+"user_name_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_name")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_surname")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_email")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_name",t.result_data[0].nome),localStorage.setItem(i.app_s.COMPANY_KEY+"user",t.result_data[0].username),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname",t.result_data[0].cognome),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email",t.result_data[0].email),i.user_idp=t.result_data[0].username,i.user_nome=t.result_data[0].nome,i.user_cognome=t.result_data[0].cognome,i.user_email=t.result_data[0].email,i.imp="ANNULLA IMP: "+t.result_data[0].cognome+" "+t.result_data[0].nome,i.get_grid().doFill(""))}))})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj=new Object,this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.app_s.getState().wkf_obj.title,this.init_end(),this.app_s.getState().topnavTitle=this.att_panelcat},t.prototype.init_Panel=function(t,n){var o=this;if(null==this.app_s.getState().wkf_obj||this.app_s.getState().wkf_obj.codice_app!=t){null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")&&(this.imp="ANNULLA IMP: "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname")+" "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"));var e=new D;e.sql="SELECT_WKF_APP_INFO",e.types=["string"];var s=!(e.values=[t]);this.m_dataService.doQuery(e).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;s=!0,o.m_id_Doc=n,o.id_applicativo=e[0].id_gruppo,o.app_root=e[0].modulo_swf,o.codice_app=e[0].codice_documento,o.att_panelcat=e[0].descrizione_breve,o.documento_pubblico=e[0].pubblico,o.titolo_email="["+e[0].descrizione_breve+"]",o.tbl_name=e[0].vista_sql,o.grid_key=o.app_s.COMPANY_KEY+e[0].vista_sql,o.user_idp=localStorage.getItem(o.app_s.COMPANY_KEY+"user"),o.user_nome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_name"),o.user_cognome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_surname"),o.user_email=localStorage.getItem(o.app_s.COMPANY_KEY+"user_email"),o.app_s.getState().topnavTitle=o.att_panelcat;var i=new D;i.sql="SELECT_UTENTE_WKF_ADMIN",i.types=["string","string"],i.values=[o.id_applicativo,localStorage.getItem(o.app_s.COMPANY_KEY+"user")],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;o.is_Supervisor=!1,o.is_Admin=!1,0<e.length&&(o.is_Supervisor=!0,"1"==e[0].tipo&&(o.is_Admin=!0)),s=!0;var i=new D;i.sql="SELECT_WLIVELLIV2",i.types=["string","string"],i.values=[o.id_applicativo,""],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(o.init_end(),o.ok_conf_s(t.result_data),s=!0),s||console.error(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),s=!0}s||console.error(t.msg)},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this.restore_state_wkf()},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if((this.livs[e].idp.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].gruppo_parallelo)&&10==this.livs[e].livello&&0==this.livs[e].notifica){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.insert_doc=function(){this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t}(),Wt=function(){function t(t,e,i,n,o,s,r,a){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this.m_dialog=o,this.m_route=s,this.m_wkf=r,this.uti_s=a,this.m_obj=new Object,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.oper="",this.forza_canale="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.opx="",this.tn_selectedIndex=0,this.default_tab=1,this.b_annulla=!1,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1,this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email"),console.log("user_idp: "+this.user_idp)}return t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info=new Object,this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento},t.prototype.evt_salv=function(){this.btnprocedi=!1,this.salva()},t.prototype.salva=function(){if(""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].livello,console.log("-----------"),console.log(this.livs[e]));else{if(t=this.m_obj.stato,null!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo){this.clevel=this.livs[e];break}if(null==this.clevel)for(e=0;e<this.livs.length;e++)if(console.log(this.livs[e]),this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||(console.log(this.c_canale+" "+this.livs[e].gruppo_parallelo),0!=this.livs[e].notifica||""!=this.c_canale&&""!=this.livs[e].gruppo_parallelo&&this.c_canale!=this.livs[e].gruppo_parallelo&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo))){this.clevel=this.livs[e];break}}if(this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].livello>t&&0!=t&&this.livs[e].livello!=i&&(-1==this.limite_salto_after||this.livs[e].livello<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].livello);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].gruppo_parallelo||this.c_canale==this.livs[o].gruppo_parallelo)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}if("procedi"==this.oper){if(console.log("this.oper "+this.clevel.livelli_jump),null==this.clevel.livelli_jump&&(this.clevel.livelli_jump=""),""!=this.clevel.livelli_jump)return console.log("selectLevel "+this.clevel.livelli_jump),void this.selectLevel(this.clevel.livelli_jump);this.calcolanextandjump()}if("respingi"==this.oper){if(null==this.clevel.livelli_down&&(this.clevel.livelli_down=""),""!=this.clevel.livelli_down)return void this.selectLevel(this.clevel.livelli_down);this.alert("Errore di configurazione pratica contattare ufficio IT [0x004]",1)}}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.selectLevel=function(t){var o=this;this.app_s.getState().wkf_doc_info.livs=this.livs,this.app_s.getState().wkf_doc_info.st=t,this.app_s.getState().wkf_doc_info.cl=this.clevel,this.m_dialog.open(Tt,{disableClose:!0}).afterClosed().subscribe(function(t){if(null!=t){var e=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){e=o.wkf_rule(e);var i=!1;for(n=0;n<o.livs.length;n++)o.user_idp.toUpperCase()==o.livs[n].idp.toUpperCase()&&0==o.livs[n].notifica&&o.livs[n].livello==e&&(o.nlevel=o.livs[n],e=o.livs[n].livello,i=!0);if(!i)for(n=0;n<o.livs.length;n++)if(o.livs[n].livello==e&&0==o.livs[n].notifica){o.nlevel=o.livs[n],e=o.livs[n].livello;break}o.doJump()}else{for(var n=e=0;n<o.livs.length;n++)o.livs[n].livello<900&&o.livs[n].livello>e&&0==o.livs[n].notifica&&(o.clevel=o.livs[n],e=o.livs[n].livello);o.calcolanextandjump()}else o.calcolanextandjump()}else o.edit_b(!0)})},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello,console.log("liv: "+t);for(var i=0;i<this.livs.length;i++)(0==t||t<this.livs[i].livello&&e>this.livs[i].livello)&&(this.nlevel=this.livs[i],e=this.livs[i].livello);t=this.wkf_rule(e);var n=!1;for(i=0;i<this.livs.length;i++)0!=this.livs[i].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo||this.livs[i].livello==t&&(this.nlevel=this.livs[i],t=this.livs[i].livello,n=!0);if(!n)for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==t&&0==this.livs[i].notifica){this.nlevel=this.livs[i],t=this.livs[i].livello;break}var o=t,s=this.nlevel;if(2==this.nlevel.salto_iniziale){for(i=0;i<this.livs.length;i++)s.idp.toUpperCase()==this.livs[i].idp.toUpperCase()&&0==this.livs[i].notifica&&s.gruppo_parallelo==this.livs[i].gruppo_parallelo&&this.livs[i].livello>o&&0!=o&&(this.nlevel=this.livs[i],t=this.livs[i].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var e=this;this.user_idp.toUpperCase();if(null!=this.nlevel){var i=new Array;if(""==this.clevel.gruppo_parallelo)for(var t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&i.push(this.livs[t]);else{var n=!1;for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&""!=this.livs[t].gruppo_parallelo&&(n=!0);console.log("canale: "+this.clevel.gruppo_parallelo);for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&(console.log("canale: "+this.clevel.gruppo_parallelo+" "+this.livs[t].gruppo_parallelo),this.clevel.gruppo_parallelo!=this.livs[t].gruppo_parallelo&&n||(i.push(this.livs[t]),this.nlevel=this.livs[t]))}if(0!=i.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title="Avanzamento";for(var o="",s=0;s<i.length;s++)""!=o&&(o+=";"),o+=i[s].nc;this.app_s.getState().wkf_doc_info.utenti="",this.nlevel.livello<900?this.app_s.getState().wkf_doc_info.lbl="Il documento verrà inviato a "+this.nlevel.descri_livello:this.app_s.getState().wkf_doc_info.lbl="La richiesta verrà chiusa con stato: "+this.nlevel.descri_livello,this.app_s.getState().wkf_doc_info.utenti=o,1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.m_dialog.open(Dt,{disableClose:!0}).afterClosed().subscribe(function(t){if("abort"==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=i,e.nota=t,e.OKCOM()})}else{this.app_s.getState().wkf_doc_info.title="Assegnazione",1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.app_s.getState().wkf_doc_info.arrAutori=i.sort(function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}),this.m_dialog.open(Nt,{disableClose:!0}).afterClosed().subscribe(function(t){if(""==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=t.arrsel,e.nota=t.nota,e.OKCOM()})}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)}else this.alert("problema di configurazione passaggio avanti dal livello "+this.clevel.descri_livello+" non attivato comunicare al CED",1)},t.prototype.OKCOM=function(){var i=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),this.m_danotificare="";for(var t,e=this.m_autori="",n=0;n<this.arrUsersSelected.length;n++)""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[n].idp,-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[n].idp),console.log("m_lettori2 "+this.m_lettori),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[n].idp,e+=this.arrUsersSelected[n].nc),console.log("m_lettori3 "+this.m_lettori);""!=this.nota&&this.insert_commento(this.id_applicativo,this.id_documento,this.nota,this.user_idp),this.m_liv=this.nlevel.livello,this.m_statox="Assegnata a:"+e,this.m_autori_paralleli="",this.m_obj.assegnati_paralleli="",this.chstato(this.m_liv),this.m_obj.stato<=10&&this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp);for(n=0;n<this.livs.length;n++)this.livs[n].livello==this.m_liv&&1==this.livs[n].notifica&&(1==this.livs[n].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[n].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[n].idp));if(900<=this.nlevel.livello){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello),(r=new D).sql="UPDATE_DATA_CHIUSURA",r.values=[this.id_applicativo,this.id_documento],r.types=["string","string"],this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})}t=this.app_info.documento_pubblico?new Array(this.m_autori,"",this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento):new Array(this.m_autori,this.m_lettori,this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento);for(var o=new Array,s=0;s<t.length;s++)o.push("string");if(this.m_crea_att=1,900<=this.m_liv&&(this.m_crea_att=0),this.b_respingi&&(this.m_oper="Respinta"),null!=this.clevel&&null!=this.clevel.descri_livello&&(this.m_oper=this.m_oper+" - "+this.clevel.descri_livello),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(this.m_oper=this.m_oper+" -> "+this.nlevel.descri_livello),(r=new D).sql="doWKF",r.values=[this.app_info.descrizione_breve,this.m_obj.codice,this.m_autori,this.m_danotificare,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"La scheda numero: "+this.m_obj.codice+" è passata allo stato: "+this.m_statox,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,this.m_statox,this.m_oper,this.id_applicativo,this.id_documento,""+this.m_crea_att,""+this.m_send_email,""+this.clevel.livello,""+this.nlevel.livello],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.clevel.livello+"_PLAYER",this.user_idp),this.m_wkf.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(r=new D).sql="UPDATE_WKF_DOCUMENTOV3_NS",r.values=t,r.types=o,this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),""!=this.m_danotificare){var r,a="";if(""!=this.nota&&(a="<br>Commento: "+this.nota),1==this.clevel.ccn_mittente&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.user_idp),(r=new D).sql="exec_app_workflow",r.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp],this.m_wkf.doQuery(r).subscribe(function(t){},function(t){}),1==this.nlevel.approvazione_email);else if(1==this.nlevel.email_partecipanti||1==this.nlevel.email_ospiti)if(this.b_respingi)this.sendEMail_ex(this.user_idp,this.m_danotificare,"Respinta "+this.getTitle()+"-["+this.m_obj.codice+"]","<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+"<br>Commenti:"+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota);else if(console.log("--------------this.clevel.oggetto_text----------------------"),console.log(this.nlevel.oggetto_email),null==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota);else if(""==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota);else{var l=this.nlevel.oggetto_email;for(var p in console.log("OGGETTO CUSTOM!"),this.m_obj)null!=this.m_obj[p]&&(console.log(p+" "+Object.prototype.toString.call(this.m_obj[p])),l="[object Date]"===Object.prototype.toString.call(this.m_obj[p])?l.split("%"+p+"%").join(this.uti_s.date2String(this.m_obj[p])):-1==(""+this.m_obj[p]).indexOf("T00:00:00")?l.split("%"+p+"%").join(this.m_obj[p]):l.split("%"+p+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[p],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,l,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota)}else this.goto_edit_doc()}},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){var c=this;void 0===p&&(p=!0);var u=new D;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l],this.m_wkf.doQuery(u).subscribe(function(t){c.goto_edit_doc(p)},function(t){})},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].livello)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=this,s=new D;s.sql="INSERT_WKF_COMMENTO",s.values=[t,e,i,n],s.types=["string","string","string","string"],this.m_dataService.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=this,s=new D;s.sql="insert_wkf_variabile",s.values=[t,e,i,n],this.m_wkf.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.respingi=function(){if(this.oper="respingi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(){var e=this,t=this.m_dialog.open(jt,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_commenti=function(){var e=this,t=this.m_dialog.open(Lt,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_upload=function(){var e=this;this.m_dialog.open(Mt,{disableClose:!0}).afterClosed().subscribe(function(t){e.r_count()})},t.prototype.create_new_document=function(){var i=this,t=new D;t.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),t.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.save_agg(),e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.save_agg=function(){var i=this;this.edit_b(!1);var t=this.getfieldvalues(),e=new D;e.sql="insert_aggiuntivi",e.types=["string","string"],e.values=[this.app_info.tabella_dati,this.id_documento],e.names=["tabella","id_documento"];for(var n=0;n<t.length;n++)e.types.push(t[n].types),e.names.push(t[n].names),null!=t[n].values?("int"==t[n].types&&e.values.push(""+t[n].values),"string"==t[n].types&&e.values.push(""+t[n].values),"date"==t[n].types&&e.values.push(this.uti_s.sql_date(t[n].values)),"datetime"==t[n].types&&e.values.push(this.uti_s.sql_date_time(t[n].values)),"decimal"==t[n].types&&e.values.push(""+t[n].values)):e.values.push("dbnull"),console.log(e.names[n+2]+" "+e.values[n+2]);this.m_wkf.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_insert_aggiuntivi(),e=!0),e||(i.errorMsg=t.msg)},function(t){})},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.edit_b(!0),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var n=this;console.log("load_document()");var t=new D;t.sql="SELECT_WKF_DOCUMENT_NOREP",t.types=["string","string","string"],t.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;0<i.length?n.ok_load_document(i[0]):n.alert("DOCUMENTO NON TROVATO",1),e=!0}e||(n.errorMsg=t.msg)},function(t){})},t.prototype.ok_load_document=function(t){var i=this;console.log(t),this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1),this.save_to_app_state();var e=new D;e.sql="SELECT_LIVELLI_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_livelli_doc(t.result_data),e=!0),e||(i.errorMsg=t.msg)},function(t){})},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.over_canale_iniz(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].idp.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||10==this.livs[e].livello&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var r=this,t=new D;t.sql="SELECT_WKF_ALLEGATI_COUNTER",t.types=["string","string"],t.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){for(var i=t.result_data,n=0,o=0,s=0;s<i.length;s++)0<i[s].n&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));r.reset_counters(o,n),e=!0}e||(r.errorMsg=t.msg)},function(t){})},t.prototype.set_canale_iniziale=function(t){console.log("Forza canale "+t),this.forza_canale=t},t.prototype.over_canale_iniz=function(){if(""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale,console.log("-------------"+this.forza_canale+"--------------------"),console.log(this.livs[e]));console.log("forza canale exec"+this.forza_canale),this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale),this.c_canale=this.forza_canale}},t.prototype.ck_canale_multiplo=function(){for(var e=this,t=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<t||0==t)&&(this.clevel=this.livs[i],t=this.livs[i].livello);console.log(t),console.log(this.app_s.getState().wkf_doc_info.curr_user.toUpperCase());var n=new Array;for(i=0;i<this.livs.length;i++)this.livs[i].livello==t&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].idp.toUpperCase()&&(null!=this.livs[i].gruppo_parallelo?n.push(this.livs[i].gruppo_parallelo):n.push(""));n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort(function(t,e){return e<t?1:t<e?-1:0}),this.m_dialog.open(kt,{disableClose:!0}).afterClosed().subscribe(function(t){e.c_canale=t,e.create_new_document()}))},t.prototype.open_info=function(){var t=this.m_dialog.open(Ft,{disableClose:!0});t.componentInstance.hide_richiedente=this.hide_richiedente,t.afterClosed().subscribe(function(t){})},t.prototype.setForceJump=function(t,e){var i,n=this;void 0===e&&(e="");for(var o,s="",r="",a="",l=0;l<this.livs.length;l++)t!=this.livs[l].livello||0!=this.livs[l].notifica||""!=e&&!this.livs[l].canale||(""!=s&&(s+=","),s+=this.livs[l].idp,""!=r&&(r+=","),r+=this.livs[l].nc,a=this.livs[l].descri_livello);if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;o=this.app_info.documento_pubblico?new Array(s,"",t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento):new Array(s,this.m_obj.partecipanti+","+s,t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento);var p=new Array;for(l=0;l<o.length;l++)p.push("string");return(i=new D).sql="doWKF",i.values=[this.app_info.descrizione_breve,this.m_obj.codice,""+t,""+t,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"La scheda numero: "+this.m_obj.codice+" è passata allo stato: "+a,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,a,"",this.id_applicativo,this.id_documento,"1","0",""+this.m_obj.stato,""+t],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.m_obj.stato+"_PLAYER",this.user_idp),this.m_wkf.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(i=new D).sql="UPDATE_WKF_DOCUMENTOV3_NS",i.values=o,i.types=p,this.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),this.goto_edit_doc(),"OK"},t.prototype.insert_doc=function(){var i=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.enabled_form(),this.app_s.getState().topnavTitle=this.app_info.descrizione_breve+" - Nuova Richiesta",this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_counters(0,0);var t=new D;t.sql="SELECT_WLIVELLIV2",t.types=["string","string"],t.values=[this.id_applicativo,""],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(console.log(t.result_data),i.ok_livw2(t.result_data),e=!0),e||(i.errorMsg=t.msg)},function(t){}),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&(e=this.livs[i].livello);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(this.user_idp.toUpperCase()==this.livs[i].idp.toUpperCase()||"*ALLUSERS"==this.livs[i].gruppo_parallelo)){1==this.livs[i].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1,this.edit_b(!0);break}},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){console.log("return_edit");for(var t=0;t<this.livs.length;t++)if(this.livs[t].livello==this.m_obj.stato){1==this.livs[t].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}-1!=this.m_obj.autori.toLowerCase().indexOf(this.user_idp.toLowerCase())&&(this.edit_b(!0),this.respingi_enabled&&this.resp_b(!0)),this.r_count();var e=this.m_obj.autori.split(",");for(t=0;t<e.length;t++)for(var i=0;i<this.livs.length;i++)if(this.livs[i].idp==e[t]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[i].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.app_s.getState().topnavTitle=this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato,this.reset_form(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato)},t.prototype.onResize=function(t){},t.prototype.ngOnInit=function(){var n=this;this.m_route.params.subscribe(function(t){n.onResize();var e=t.op;if(n.id_applicativo=t.idapp,n.id_documento=t.id_doc,n.b_edit="new"!=e,n.b_edit||-1<n.id_applicativo.indexOf("_")&&(n.simple_mode=!0,n.id_applicativo=n.id_applicativo.split("_").join("")),n.b_valid=!!n.id_applicativo,n.b_valid){var i=new D;i.sql="SELECT_WKF_APP_INFO_BYUID",i.types=["string"],i.values=[n.id_applicativo],n.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(0<t.result_data.length?(n.setta_info_app(t.result_data[0]),n.b_edit?n.edit_doc():n.insert_doc()):n.alert("CODICE APPLICAZIONE NON VALIDO",2),e=!0),e||n.alert(t.msg,2)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",2)})}else n.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)})},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].livello)return""!=this.livs[i].livello?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].idp.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},t.propDecorators={onResize:[{type:l.HostListener,args:["window:resize",["event"]]}]},t}();t.FluxhubLibModule=qt,t.AppService=R,t.AppMakerService=A,t.FileService=C,t.OdbcService=w,t.QueryService=Y,t.WkfService=Pt,t.GridService=Q,t.AuthenticationService=Kt,t.UtilityService=P,t.FHGuard=Bt,t.FHGridComponent=$,t.ApprovaGridComponent=nt,t.CurrencyComponent=V,t.DateComponent=F,t.DtPick=ht,t.dt=Ht,t.NumericEditorComponent=L,t.ComboBoxEditor=lt,t.TextAreaEditor=at,t.FHAutoCompleteComponent=tt,t.FHComboboxComponent=X,t.FHConfirmComponent=q,t.FHCurrencyFieldComponent=yt,t.FHCurrencyFormatterDirective=st,t.FHCurrencyPipe=ot,t.FHDatePickerComponent=et,t.FHListComponent=pt,t.FHLogPanelComponent=mt,t.FHMdReader=gt,t.FHNumericFieldComponent=Ot,t.ReplaceLineBreaks=ut,t.FHRichText=It,t.FHTimePickerComponent=K,t.FHUploadComponent=G,t.FHUploadPanelComponent=B,t.FHUserFieldComponent=Ct,t.FHUserPickerComponent=it,t.FHPickListComponent=dt,t.FHUtility=Gt,t.WinAskNumberComponent=_t,t.WinAskTextComponent=J,t.WinAskTextBigComponent=ft,t.FHWinComboSelect=ct,t.FHListPick=Rt,t.win_mappa=rt,t.WinOutputComponent=St,t.win_time_slider=z,t.WinWait=H,t.QGParam=Z,t.QGResult=k,t.QParam=D,t.QResult=N,t.FSInput=T,t.FSResult=Vt,t.wkfapp=Qt,t.dati_aggiuntivi=Wt,t.ɵa=vt,t.ɵh=W,t.ɵb=Et,t.ɵc=bt,t.ɵd=wt,t.ɵe=M,t.ɵg=U,t.ɵf=j,t.ɵj=Nt,t.ɵo=Lt,t.ɵu=xt,t.ɵk=Dt,t.ɵp=Ft,t.ɵq=jt,t.ɵr=zt,t.ɵs=Ut,t.ɵt=Yt,t.ɵi=At,t.ɵl=kt,t.ɵm=Tt,t.ɵn=Mt,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=fluxhub-fluxhub-lib.umd.min.js.map
|