@fluxhub/fluxhub-lib 1.0.597 → 1.0.599

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.
@@ -3130,918 +3130,523 @@ var WinWait = /** @class */ (function () {
3130
3130
  * @fileoverview added by tsickle
3131
3131
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3132
3132
  */
3133
- var FHUploadComponent = /** @class */ (function () {
3134
- function FHUploadComponent(_dataService, toastr, dialog, app_s) {
3135
- var _this = this;
3133
+ var FHComboboxComponent = /** @class */ (function () {
3134
+ function FHComboboxComponent(_dataService, _dataService_odbc) {
3136
3135
  this._dataService = _dataService;
3137
- this.toastr = toastr;
3138
- this.dialog = dialog;
3139
- this.app_s = app_s;
3140
- this.show_descri = true;
3136
+ this._dataService_odbc = _dataService_odbc;
3137
+ this.init_fill = true;
3138
+ this.sql = "";
3139
+ this.types = [];
3140
+ this.values = [];
3141
+ this.hidden = false;
3142
+ this.label = "";
3141
3143
  this.enabled = true;
3142
- this.single = true;
3143
- this.descri_obb = false;
3144
- this.programma_da_eseguire = '';
3145
- this.label_attendere = 'ATTENDERE UPLOAD IN CORSO';
3146
- this.fixed_label = ' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)';
3147
- this.limit_string = 'Il file di <size>MB supera il limite di 500MB';
3148
- this.allegato_inserito = 'ALLEGATO INSERITO';
3149
- this.inserire_descrizione = 'Descrizione Obbligatoria';
3150
- this.lista_allegati = [];
3151
- this.change = new EventEmitter();
3152
- this.upload_ended = new EventEmitter();
3153
- this.allow_delete = false;
3154
- this.loading = false;
3155
- this.App = '';
3156
- this.K = '';
3157
- this.label_b = "";
3158
- this.descrizione = '';
3159
- this.file_name = '';
3160
- this.label = '';
3161
- this.username = '';
3162
- this.b_edit_loaded = false;
3163
- this.tipo = '';
3164
- this.b_ini = false;
3165
- this.uploader = new FileUploader({
3166
- url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT,
3167
- 'maxFileSize': 500 * 1024 * 1024
3168
- });
3169
- this.id = null;
3170
- this.username = this.app_s.user;
3171
- this.uploader.onBeforeUploadItem = (/**
3172
- * @param {?} item
3173
- * @return {?}
3174
- */
3175
- function (item) {
3176
- item.withCredentials = false;
3177
- });
3178
- this.uploader.onCompleteItem = (/**
3179
- * @param {?} item
3180
- * @param {?} response
3181
- * @param {?} status
3182
- * @param {?} header
3183
- * @return {?}
3184
- */
3185
- function (item, response, status, header) {
3186
- if (status === 200) {
3187
- _this.descrizione = "";
3188
- _this.toastr.info("INFO", _this.allegato_inserito, {
3189
- timeOut: 1000,
3190
- progressBar: true
3191
- });
3192
- _this.ref_allegato();
3193
- _this.change.emit({ item: item, response: response, status: status, header: header });
3194
- }
3195
- });
3144
+ this.required = false;
3145
+ this.sel_label = "";
3146
+ this.fillend = new EventEmitter();
3147
+ this.selchange = new EventEmitter();
3148
+ this.initend = new EventEmitter();
3149
+ this.myData = [];
3150
+ this.valDef = "-1";
3151
+ this.selval = "-1";
3152
+ this.errorMsg = "";
3153
+ this.db_type = "1";
3154
+ this.dis_value = '';
3155
+ this.descri_val = "";
3196
3156
  }
3197
3157
  /**
3158
+ * @private
3198
3159
  * @return {?}
3199
3160
  */
3200
- FHUploadComponent.prototype.del_doc = /**
3161
+ FHComboboxComponent.prototype.update_dis = /**
3162
+ * @private
3201
3163
  * @return {?}
3202
3164
  */
3203
3165
  function () {
3204
- var _this = this;
3205
- localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
3206
- localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
3207
- /** @type {?} */
3208
- var dialogRef = this
3209
- .dialog
3210
- .open(FHConfirmComponent);
3211
- dialogRef
3212
- .afterClosed()
3213
- .subscribe((/**
3214
- * @param {?} result
3215
- * @return {?}
3216
- */
3217
- function (result) {
3218
- if (result) {
3219
- /** @type {?} */
3220
- var p = new QParam();
3221
- p.sql = "DELETE_ALLEGATO";
3222
- p.types = ['int', 'string'];
3223
- p.values = [_this.id, _this.app_s.user];
3224
- _this
3225
- ._dataService
3226
- .doQuery(p)
3227
- .subscribe((/**
3228
- * @param {?} data
3229
- * @return {?}
3230
- */
3231
- function (data) {
3232
- if (data != null)
3233
- if (data.result_msg == "OK") {
3234
- // this.arr_g = data.result_data;
3235
- _this.ref_allegato();
3236
- _this
3237
- .toastr
3238
- .info("INFO", "ALLEGATO ELIMINATO", {
3239
- timeOut: 1000,
3240
- progressBar: true
3241
- });
3242
- }
3243
- }), (/**
3244
- * @param {?} err
3245
- * @return {?}
3246
- */
3247
- function (err) {
3248
- }));
3249
- }
3250
- }));
3166
+ this.dis_value = '';
3167
+ try {
3168
+ if (this.descri_val != null)
3169
+ if (this.descri_val != "") {
3170
+ this.dis_value = this.descri_val;
3171
+ return;
3172
+ }
3173
+ if (this.valDef == null)
3174
+ this.dis_value = '';
3175
+ else
3176
+ this.dis_value = this.valDef.split('-1').join('');
3177
+ }
3178
+ catch (e) {
3179
+ console.log('errore split -> this.valDef ', this.valDef);
3180
+ }
3251
3181
  };
3252
3182
  /**
3253
3183
  * @return {?}
3254
3184
  */
3255
- FHUploadComponent.prototype.ngOnInit = /**
3185
+ FHComboboxComponent.prototype.resetValue = /**
3256
3186
  * @return {?}
3257
3187
  */
3258
3188
  function () {
3259
- var _this = this;
3260
- /** @type {?} */
3261
- var uo = {};
3262
- uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
3263
- this.uploader.setOptions(uo);
3264
- this.uploader.onCompleteAll = (/**
3265
- * @return {?}
3266
- */
3267
- function () {
3268
- _this.loading = false;
3269
- _this.upload_ended.emit();
3270
- if (_this.dialogRef != null)
3271
- if (_this.dialogRef.componentInstance != null) {
3272
- _this.dialogRef.componentInstance.update_progess(100);
3273
- _this.dialogRef = null;
3274
- }
3275
- });
3276
- this.uploader.onErrorItem = (/**
3277
- * @param {?} a
3278
- * @param {?} b
3279
- * @param {?} c
3280
- * @param {?} d
3281
- * @return {?}
3282
- */
3283
- function (a, b, c, d) {
3284
- _this.toastr.error(b);
3285
- });
3286
- this.uploader.onAfterAddingFile = (/**
3287
- * @param {?} fileItem
3288
- * @return {?}
3289
- */
3290
- function (fileItem) {
3291
- _this.ch(fileItem);
3292
- });
3293
- this.uploader.onProgressItem = (/**
3294
- * @param {?} fileItem
3295
- * @param {?} progress
3296
- * @return {?}
3297
- */
3298
- function (fileItem, progress) {
3299
- // console.log(fileItem);
3300
- // console.log(progress);
3301
- _this.loading = true;
3302
- if (_this.dialogRef != null)
3303
- if (_this.dialogRef.componentInstance != null)
3304
- _this.dialogRef.componentInstance.update_progess(progress);
3305
- });
3306
- this.uploader.onWhenAddingFileFailed = (/**
3307
- * @param {?} item
3308
- * @param {?} filter
3309
- * @param {?} options
3310
- * @return {?}
3311
- */
3312
- function (item, filter, options) {
3313
- switch (filter.name) {
3314
- case 'fileSize':
3315
- /** @type {?} */
3316
- var ar = Math.round(item.size / 1024 / 1024);
3317
- _this.toastr.error(_this.limit_string.split('<size>').join('' + ar));
3318
- break;
3319
- default:
3320
- _this.toastr.error("Errore: " + filter.name);
3321
- }
3322
- });
3189
+ this.selval = '-1';
3190
+ this.valDef = '-1';
3191
+ this.update_dis();
3323
3192
  };
3324
3193
  /**
3325
3194
  * @return {?}
3326
3195
  */
3327
- FHUploadComponent.prototype.download_all = /**
3196
+ FHComboboxComponent.prototype.focus = /**
3328
3197
  * @return {?}
3329
3198
  */
3330
3199
  function () {
3331
- window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + this.App + '/' + this.K + '/' + this.file_name);
3200
+ this.smtr.nativeElement.focus();
3332
3201
  };
3333
3202
  /**
3334
- * @param {?} fileItem
3335
3203
  * @return {?}
3336
3204
  */
3337
- FHUploadComponent.prototype.ch = /**
3338
- * @param {?} fileItem
3205
+ FHComboboxComponent.prototype.reset = /**
3339
3206
  * @return {?}
3340
3207
  */
3341
- function (fileItem) {
3208
+ function () {
3209
+ console.log('reset');
3210
+ this.selval = '-1';
3211
+ this.valDef = '-1';
3212
+ this.myData = new Array();
3213
+ this.update_dis();
3214
+ };
3215
+ /**
3216
+ * @return {?}
3217
+ */
3218
+ FHComboboxComponent.prototype.fillCombo = /**
3219
+ * @return {?}
3220
+ */
3221
+ function () {
3342
3222
  var _this = this;
3343
- if (this.descri_obb && this.descrizione == '') {
3344
- this.toastr.error(this.inserire_descrizione);
3223
+ // console.log(this.init_fill);
3224
+ // if(!this.init_fill){this.init_fill=true;return;}
3225
+ console.log("fillcombo " + this.sql);
3226
+ if (this.sql.indexOf('|') != -1 && this.sql.indexOf('$') != -1) {
3227
+ this.set_options(this.sql);
3345
3228
  return;
3346
3229
  }
3347
- for (var i = 0; i < this.lista_allegati.length; i++) {
3348
- if (this.lista_allegati[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
3349
- this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
3350
- return;
3351
- }
3352
- }
3353
- this.uploader.onBuildItemForm = (/**
3354
- * @param {?} item
3355
- * @param {?} form
3356
- * @return {?}
3357
- */
3358
- function (item, form) {
3359
- form.append('App', _this.App);
3360
- form.append('K', _this.K);
3361
- form.append('descrizione', _this.descrizione);
3362
- form.append('single', _this.single);
3363
- form.append('username', _this.username);
3364
- form.append('tipo', _this.tipo);
3365
- form.append('local_path', _this.app_s.LOCAL_PATH);
3366
- if (_this.programma_da_eseguire != '')
3367
- form.append('p1', _this.programma_da_eseguire);
3368
- });
3369
- if (this.dialogRef == null) {
3370
- this.dialogRef = this.dialog.open(WinWait, { 'disableClose': true });
3371
- this.dialogRef.componentInstance.label = this.label_attendere;
3372
- this.dialogRef.afterClosed().subscribe((/**
3373
- * @param {?} result
3230
+ /** @type {?} */
3231
+ var p = new QParam();
3232
+ p.sql = this.sql;
3233
+ p.types = this.types;
3234
+ p.values = this.values;
3235
+ // console.log(p);
3236
+ if (this.db_type == "1")
3237
+ this
3238
+ ._dataService
3239
+ .doQuery(p)
3240
+ .subscribe((/**
3241
+ * @param {?} data
3374
3242
  * @return {?}
3375
3243
  */
3376
- function (result) {
3244
+ function (data) {
3245
+ if (data != null)
3246
+ if (data.result_msg == "OK") {
3247
+ _this.resetD(data.result_data);
3248
+ }
3249
+ }), (/**
3250
+ * @param {?} err
3251
+ * @return {?}
3252
+ */
3253
+ function (err) {
3254
+ _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
3255
+ }));
3256
+ if (this.db_type == "2")
3257
+ this
3258
+ ._dataService_odbc
3259
+ .doQuery(p)
3260
+ .subscribe((/**
3261
+ * @param {?} data
3262
+ * @return {?}
3263
+ */
3264
+ function (data) {
3265
+ if (data != null)
3266
+ if (data.result_msg == "OK") {
3267
+ for (var i = 0; i < data.result_data.length; i++) {
3268
+ if (data.result_data[i].VALORE != null)
3269
+ data.result_data[i].valore = data.result_data[i].VALORE;
3270
+ if (data.result_data[i].DESCRIZIONE_VALORE != null)
3271
+ data.result_data[i].descrizione_valore = data.result_data[i].DESCRIZIONE_VALORE;
3272
+ }
3273
+ _this.resetD(data.result_data);
3274
+ }
3275
+ }), (/**
3276
+ * @param {?} err
3277
+ * @return {?}
3278
+ */
3279
+ function (err) {
3280
+ _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
3377
3281
  }));
3378
- }
3379
- this.uploader.uploadAll();
3380
3282
  };
3381
3283
  /**
3382
- * @param {?} p_app
3383
- * @param {?} p_k
3384
- * @param {?} p_label
3385
- * @param {?=} p_tipo
3386
- * @param {?=} programma_da_eseguire
3387
- * @param {?=} allow_delete
3284
+ * @param {?} o
3388
3285
  * @return {?}
3389
3286
  */
3390
- FHUploadComponent.prototype.init = /**
3391
- * @param {?} p_app
3392
- * @param {?} p_k
3393
- * @param {?} p_label
3394
- * @param {?=} p_tipo
3395
- * @param {?=} programma_da_eseguire
3396
- * @param {?=} allow_delete
3287
+ FHComboboxComponent.prototype.add_option = /**
3288
+ * @param {?} o
3397
3289
  * @return {?}
3398
3290
  */
3399
- function (p_app, p_k, p_label, p_tipo, programma_da_eseguire, allow_delete) {
3400
- if (p_tipo === void 0) { p_tipo = ""; }
3401
- if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
3402
- if (allow_delete === void 0) { allow_delete = false; }
3403
- this.App = p_app;
3404
- this.K = p_k;
3405
- this.label = p_label;
3406
- this.tipo = p_tipo;
3407
- this.b_ini = true;
3408
- this.b_edit_loaded = false;
3409
- this.descrizione = "";
3410
- this.programma_da_eseguire = programma_da_eseguire;
3411
- this.allow_delete = allow_delete;
3412
- this.ref_allegato();
3291
+ function (o) {
3292
+ this.myData.push(o);
3413
3293
  };
3414
3294
  /**
3295
+ * @param {?} o
3415
3296
  * @return {?}
3416
3297
  */
3417
- FHUploadComponent.prototype.ref_allegato = /**
3298
+ FHComboboxComponent.prototype.resetD = /**
3299
+ * @param {?} o
3418
3300
  * @return {?}
3419
3301
  */
3420
- function () {
3421
- var _this = this;
3422
- this.id = null;
3423
- this.descrizione = '';
3424
- this.file_name = '';
3425
- this.label_b = '';
3426
- if (!this.single)
3302
+ function (o) {
3303
+ this.myData = o;
3304
+ this.selval = '-1';
3305
+ // console.log(this.smtr); console.log(this.smtr.nativeElement);
3306
+ this.setByValue(this.valDef);
3307
+ if (this.getValue() == "-1" && this.valDef != "-1")
3308
+ this.setByDescri(this.valDef);
3309
+ this.fillend.emit();
3310
+ };
3311
+ /**
3312
+ * @param {?} desc_val
3313
+ * @return {?}
3314
+ */
3315
+ FHComboboxComponent.prototype.setByDescri = /**
3316
+ * @param {?} desc_val
3317
+ * @return {?}
3318
+ */
3319
+ function (desc_val) {
3320
+ // console.log("setByDescri "+desc_val);
3321
+ this.valDef = desc_val;
3322
+ this.selval = '-1';
3323
+ if (desc_val == "")
3427
3324
  return;
3428
- if (this.App == null)
3325
+ if (this.myData == null)
3429
3326
  return;
3430
- if (this.App == "")
3327
+ if (this.myData.length == 0 || this.myData[0] == null)
3431
3328
  return;
3432
- /** @type {?} */
3433
- var p = new QParam();
3434
- p.sql = "SELECT_ALLEGATO_INFO";
3435
- p.types = ['string', 'string'];
3436
- p.values = [this.App, this.K];
3437
- this._dataService.doQuery(p).subscribe((/**
3438
- * @param {?} data
3439
- * @return {?}
3440
- */
3441
- function (data) {
3442
- if (data != null)
3443
- if (data.result_msg == "OK") {
3444
- /** @type {?} */
3445
- var a = data.result_data;
3446
- if (a.length > 0) {
3447
- _this.id = a[0].id;
3448
- _this.descrizione = a[0].descrizione;
3449
- _this.file_name = a[0].Filename;
3450
- _this.label_b = "" + a[0].Filename + " - " + a[0].Filesize + "";
3451
- _this.b_edit_loaded = true;
3452
- }
3453
- }
3454
- }));
3455
- };
3456
- FHUploadComponent.decorators = [
3457
- { type: Component, args: [{
3458
- selector: 'FHUpload',
3459
- template: "\n \n <div *ngIf=\"loading\" fxLayout=\"row\">\n WAIT\n </div>\n <div *ngIf=\"enabled && !loading\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-form-field [hidden]=\"!show_descri\" class=\"field_style\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}} {{fixed_label}}</mat-label>\n <input matInput type=\"text\" name=\"descrizione\" [(ngModel)]=\"descrizione\"\n >\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div style=\"width:140px\" fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <input type=\"file\" multiple ng2FileSelect [uploader]=\"uploader\" name=\"file-fh{{App}}\" id=\"file-fh{{App}}\" class=\"inputfile inputfile-fh\" />\n <label for=\"file-fh{{App}}\" style=\"width:210px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"17\" viewBox=\"0 0 20 17\"><path d=\"M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z\"/></svg><span style=\"font-size: 12px\">&nbsp;&nbsp;&nbsp;Upload</span></label>\n </div>\n <div fxLayout=\"row\" fxLayoutAlign=\"start start\"> \n <button mat-flat-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\" style=\"font-size: 12px\">{{label_b}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button *ngIf=\"id!=null && allow_delete\" (click)=\"del_doc()\" color=\"warn\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf=\"!enabled\" fxLayout=\"row\">\n <label>{{label}}:</label>{{descrizione}}\n <button mat-flat-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\" style=\"font-size: 12px;background-color: #F5F5F5\">{{label_b}}</button>\n\n </div>\n <div *ngIf=\"!b_ini\" style=\"color:#ff0000\"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ",
3460
- styles: ["\n\n "]
3461
- }] }
3462
- ];
3463
- /** @nocollapse */
3464
- FHUploadComponent.ctorParameters = function () { return [
3465
- { type: QueryService },
3466
- { type: ToastrService },
3467
- { type: MatDialog },
3468
- { type: AppService }
3469
- ]; };
3470
- FHUploadComponent.propDecorators = {
3471
- show_descri: [{ type: Input }],
3472
- enabled: [{ type: Input }],
3473
- single: [{ type: Input }],
3474
- descri_obb: [{ type: Input }],
3475
- programma_da_eseguire: [{ type: Input }],
3476
- label_attendere: [{ type: Input }],
3477
- fixed_label: [{ type: Input }],
3478
- limit_string: [{ type: Input }],
3479
- allegato_inserito: [{ type: Input }],
3480
- inserire_descrizione: [{ type: Input }],
3481
- lista_allegati: [{ type: Input }],
3482
- change: [{ type: Output }],
3483
- upload_ended: [{ type: Output }]
3329
+ for (var j = 0; j < this.myData.length; j++)
3330
+ if (this.myData[j].descrizione_valore == desc_val) {
3331
+ this.selval = "" + this.myData[j].valore;
3332
+ if (this.myData[j].descrizione_valore != null)
3333
+ this.descri_val = this.myData[j].descrizione_valore;
3334
+ this.update_dis();
3335
+ return;
3336
+ }
3337
+ this.update_dis();
3484
3338
  };
3485
- return FHUploadComponent;
3486
- }());
3487
-
3488
- /**
3489
- * @fileoverview added by tsickle
3490
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3491
- */
3492
- var AuthenticationService = /** @class */ (function () {
3493
- function AuthenticationService(_dataService, toastr, http, router, route, _fileService, app_s, uti_s) {
3494
- this._dataService = _dataService;
3495
- this.toastr = toastr;
3496
- this.http = http;
3497
- this.router = router;
3498
- this.route = route;
3499
- this._fileService = _fileService;
3500
- this.app_s = app_s;
3501
- this.uti_s = uti_s;
3502
- this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3503
- this.goto_after = "";
3504
- this.username = '';
3505
- this.headers = new HttpHeaders({
3506
- 'Content-Type': 'application/json',
3507
- });
3508
- }
3509
3339
  /**
3340
+ * @param {?} ind
3510
3341
  * @return {?}
3511
3342
  */
3512
- AuthenticationService.prototype.logout = /**
3343
+ FHComboboxComponent.prototype.setByIndex = /**
3344
+ * @param {?} ind
3513
3345
  * @return {?}
3514
3346
  */
3515
- function () {
3516
- this.app_s.user = null;
3517
- this.app_s.user_name = null;
3518
- this.app_s.user_surname = null;
3519
- this.app_s.user_idp = null;
3520
- this.app_s.user_email = null;
3521
- this.app_s.user_roles = null;
3522
- this.app_s.user_lang = null;
3523
- this.app_s.user_isadmin = null;
3524
- this.app_s.token = null;
3525
- localStorage.removeItem(this.app_s.COMPANY_KEY + "token");
3526
- if (this.app_s.LOGIN_EXT != 1)
3527
- this.router.navigate(['login']);
3528
- else {
3529
- window.location.href = (this.app_s.LOGOUT_URL_EXT);
3347
+ function (ind) {
3348
+ this.valDef = "";
3349
+ this.selval = '-1';
3350
+ if (this.myData == null)
3351
+ return;
3352
+ if (this.myData.length == 0 || this.myData[0] == null)
3353
+ return;
3354
+ if (this.myData.length > ind) {
3355
+ this.setByDescri(this.myData[ind].descrizione_valore);
3530
3356
  }
3531
3357
  };
3532
3358
  /**
3533
- * @param {?} username
3534
- * @param {?} password
3535
- * @param {?=} displayError
3536
3359
  * @return {?}
3537
3360
  */
3538
- AuthenticationService.prototype.login = /**
3539
- * @param {?} username
3540
- * @param {?} password
3541
- * @param {?=} displayError
3361
+ FHComboboxComponent.prototype.getObj = /**
3542
3362
  * @return {?}
3543
3363
  */
3544
- function (username, password, displayError) {
3545
- var _this = this;
3546
- if (displayError === void 0) { displayError = true; }
3547
- this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3548
- /** @type {?} */
3549
- var post_v = JSON.stringify({ username: username, password: password });
3550
- if (this.app_s.LDAP_AUTH == 1)
3551
- post_v = JSON.stringify({ username: username, password: password, ldap_auth: 1 });
3552
- return this.http.post(this.url, post_v, {
3553
- headers: this.headers
3554
- }).pipe(map((/**
3555
- * @param {?} res
3556
- * @return {?}
3557
- */
3558
- function (res) {
3559
- // Handle errors, display if enabled
3560
- /** @type {?} */
3561
- var err;
3562
- if (!res) {
3563
- err = new Error('Empty server response');
3564
- }
3565
- else if (res.result_msg === 'KO') {
3566
- err = new Error(res.msg);
3567
- }
3568
- else {
3569
- if (res.result_data.length > 0) {
3570
- localStorage.setItem(_this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
3364
+ function () {
3365
+ if (this.selval == null)
3366
+ return null;
3367
+ if (this.selval == "-1")
3368
+ return null;
3369
+ else
3370
+ for (var j = 0; j < this.myData.length; j++)
3371
+ if (this.myData[j].valore == this.selval) {
3372
+ return this.myData[j];
3571
3373
  }
3374
+ };
3375
+ /**
3376
+ * @param {?} desc_val
3377
+ * @return {?}
3378
+ */
3379
+ FHComboboxComponent.prototype.setByValue = /**
3380
+ * @param {?} desc_val
3381
+ * @return {?}
3382
+ */
3383
+ function (desc_val) {
3384
+ this.valDef = desc_val;
3385
+ this.selval = '-1';
3386
+ // console.log(this.myData);
3387
+ if ("" + desc_val == "") {
3388
+ // console.log('qqq1111');
3389
+ return;
3390
+ }
3391
+ // console.log("qui");
3392
+ if (this.myData == null)
3393
+ return;
3394
+ // console.log("qui1");
3395
+ if (this.myData.length == 0 || this.myData[0] == null)
3396
+ return;
3397
+ //console.log("qui2");
3398
+ for (var j = 0; j < this.myData.length; j++) {
3399
+ //console.log(this.myData[j].valore +' '+ desc_val);
3400
+ if (this.myData[j].valore == desc_val) {
3401
+ this.selval = "" + this.myData[j].valore;
3402
+ if (this.myData[j].descrizione_valore != null)
3403
+ this.descri_val = this.myData[j].descrizione_valore;
3404
+ this.update_dis();
3405
+ return;
3572
3406
  }
3573
- if (err) {
3574
- console.error(err);
3575
- if (displayError) {
3576
- _this.toastr.error(err.message);
3407
+ }
3408
+ this.update_dis();
3409
+ };
3410
+ /**
3411
+ * @return {?}
3412
+ */
3413
+ FHComboboxComponent.prototype.getDescri = /**
3414
+ * @return {?}
3415
+ */
3416
+ function () {
3417
+ if (!this.enabled) {
3418
+ if (this.selval == null)
3419
+ return this.valDef;
3420
+ if (this.selval == "-1")
3421
+ return this.valDef;
3422
+ }
3423
+ if (this.selval == null)
3424
+ return "-1";
3425
+ if (this.selval == "-1")
3426
+ return "-1";
3427
+ else
3428
+ for (var j = 0; j < this.myData.length; j++)
3429
+ if (this.myData[j].valore == this.selval) {
3430
+ return this.myData[j].descrizione_valore;
3577
3431
  }
3578
- throw new Error(err);
3579
- }
3580
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3581
- })), catchError((/**
3582
- * @param {?} err
3583
- * @return {?}
3584
- */
3585
- function (err) {
3586
- // In a real world app, we might use a remote logging infrastructure
3587
- // We'd also dig deeper into the error to get a better message
3588
- /** @type {?} */
3589
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3590
- console.error(errMsg); // log to console instead
3591
- throw err;
3592
- })));
3593
3432
  };
3594
3433
  /**
3595
- * @param {?} username
3596
- * @param {?=} displayError
3597
3434
  * @return {?}
3598
3435
  */
3599
- AuthenticationService.prototype.get_user_info = /**
3600
- * @param {?} username
3601
- * @param {?=} displayError
3436
+ FHComboboxComponent.prototype.getValue = /**
3602
3437
  * @return {?}
3603
3438
  */
3604
- function (username, displayError) {
3605
- var _this = this;
3606
- if (displayError === void 0) { displayError = true; }
3607
- this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3608
- /** @type {?} */
3609
- var post_v = JSON.stringify({ username_info: username });
3610
- return this.http.post(this.url, post_v, {
3611
- headers: this.headers
3612
- }).pipe(map((/**
3613
- * @param {?} res
3614
- * @return {?}
3615
- */
3616
- function (res) {
3617
- // Handle errors, display if enabled
3618
- /** @type {?} */
3619
- var err;
3620
- if (!res) {
3621
- err = new Error('Empty server response');
3622
- }
3623
- else if (res.result_msg === 'KO') {
3624
- err = new Error(res.msg);
3439
+ function () {
3440
+ // console.log(this.selval);
3441
+ if (!this.enabled) {
3442
+ if (this.selval == null)
3443
+ return this.valDef;
3444
+ if (this.selval == "-1")
3445
+ return this.valDef;
3446
+ }
3447
+ if (this.selval == null)
3448
+ return "-1";
3449
+ if (this.selval == "")
3450
+ return "-1";
3451
+ else
3452
+ return this.selval;
3453
+ };
3454
+ /**
3455
+ * @param {?} campo
3456
+ * @return {?}
3457
+ */
3458
+ FHComboboxComponent.prototype.getData = /**
3459
+ * @param {?} campo
3460
+ * @return {?}
3461
+ */
3462
+ function (campo) {
3463
+ for (var x in this.myData) {
3464
+ if (this.myData[x]['valore'] == this.selval) {
3465
+ return (this.myData[x][campo]);
3625
3466
  }
3626
- if (err) {
3627
- console.error(err);
3628
- if (displayError) {
3629
- _this.toastr.error(err.message);
3630
- }
3631
- throw new Error(err);
3467
+ else {
3468
+ continue;
3632
3469
  }
3633
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3634
- })), catchError((/**
3635
- * @param {?} err
3636
- * @return {?}
3637
- */
3638
- function (err) {
3639
- // In a real world app, we might use a remote logging infrastructure
3640
- // We'd also dig deeper into the error to get a better message
3641
- /** @type {?} */
3642
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3643
- console.error(errMsg); // log to console instead
3644
- throw err;
3645
- })));
3470
+ }
3646
3471
  };
3647
3472
  /**
3648
- * @param {?} email
3649
- * @param {?=} displayError
3473
+ * @param {?} s
3650
3474
  * @return {?}
3651
3475
  */
3652
- AuthenticationService.prototype.passrecovery = /**
3653
- * @param {?} email
3654
- * @param {?=} displayError
3476
+ FHComboboxComponent.prototype.set_options = /**
3477
+ * @param {?} s
3655
3478
  * @return {?}
3656
3479
  */
3657
- function (email, displayError) {
3658
- var _this = this;
3659
- if (displayError === void 0) { displayError = true; }
3480
+ function (s) {
3481
+ this.myData = new Array();
3660
3482
  /** @type {?} */
3661
- var post_v = JSON.stringify({ email: email, websiteroot: this.app_s.COMPANY_SITE_ROOT, op: 'send_email' });
3662
- return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
3663
- headers: this.headers
3664
- }).pipe(map((/**
3665
- * @param {?} res
3666
- * @return {?}
3667
- */
3668
- function (res) {
3669
- // Handle errors, display if enabled
3483
+ var a = s.split('$');
3484
+ for (var i = 0; i < a.length; i++) {
3670
3485
  /** @type {?} */
3671
- var err;
3672
- if (!res) {
3673
- err = new Error('Empty server response');
3674
- }
3675
- else if (res.result_msg === 'KO') {
3676
- err = new Error(res.msg);
3677
- }
3678
- if (err) {
3679
- console.error(err);
3680
- if (displayError) {
3681
- _this.toastr.error(err.message);
3682
- }
3683
- throw new Error(err);
3684
- }
3685
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3686
- })), catchError((/**
3687
- * @param {?} err
3688
- * @return {?}
3689
- */
3690
- function (err) {
3691
- // In a real world app, we might use a remote logging infrastructure
3692
- // We'd also dig deeper into the error to get a better message
3486
+ var o = new Object();
3693
3487
  /** @type {?} */
3694
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3695
- console.error(errMsg); // log to console instead
3696
- throw err;
3697
- })));
3488
+ var av = a[i].split('|');
3489
+ o.valore = av[1];
3490
+ o.descrizione_valore = av[0];
3491
+ this
3492
+ .myData
3493
+ .push(o);
3494
+ }
3495
+ this.setByValue(this.valDef);
3496
+ if (this.getValue() == "-1")
3497
+ this.setByDescri(this.valDef);
3698
3498
  };
3699
3499
  /**
3700
- * @param {?} res_rep
3701
- * @param {?=} displayError
3702
3500
  * @return {?}
3703
3501
  */
3704
- AuthenticationService.prototype.checktoken = /**
3705
- * @param {?} res_rep
3706
- * @param {?=} displayError
3707
- * @return {?}
3708
- */
3709
- function (res_rep, displayError) {
3710
- var _this = this;
3711
- if (displayError === void 0) { displayError = true; }
3712
- /** @type {?} */
3713
- var post_v = JSON.stringify({ res_rep: res_rep, op: 'check_token' });
3714
- return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
3715
- headers: this.headers
3716
- }).pipe(map((/**
3717
- * @param {?} res
3718
- * @return {?}
3719
- */
3720
- function (res) {
3721
- // Handle errors, display if enabled
3722
- /** @type {?} */
3723
- var err;
3724
- if (!res) {
3725
- err = new Error('Empty server response');
3726
- }
3727
- else if (res.result_msg === 'KO') {
3728
- err = new Error(res.msg);
3729
- }
3730
- if (err) {
3731
- console.error(err);
3732
- if (displayError) {
3733
- _this.toastr.error(err.message);
3734
- }
3735
- throw new Error(err);
3736
- }
3737
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3738
- })), catchError((/**
3739
- * @param {?} err
3740
- * @return {?}
3741
- */
3742
- function (err) {
3743
- // In a real world app, we might use a remote logging infrastructure
3744
- // We'd also dig deeper into the error to get a better message
3745
- /** @type {?} */
3746
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3747
- console.error(errMsg); // log to console instead
3748
- throw err;
3749
- })));
3750
- };
3751
- /**
3752
- * @param {?} token
3753
- * @param {?} password
3754
- * @param {?=} displayError
3755
- * @return {?}
3756
- */
3757
- AuthenticationService.prototype.change_password = /**
3758
- * @param {?} token
3759
- * @param {?} password
3760
- * @param {?=} displayError
3761
- * @return {?}
3762
- */
3763
- function (token, password, displayError) {
3764
- var _this = this;
3765
- if (displayError === void 0) { displayError = true; }
3766
- /** @type {?} */
3767
- var post_v = JSON.stringify({ token: token, password: password, op: 'change_password' });
3768
- return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
3769
- headers: this.headers
3770
- }).pipe(map((/**
3771
- * @param {?} res
3772
- * @return {?}
3773
- */
3774
- function (res) {
3775
- // Handle errors, display if enabled
3776
- /** @type {?} */
3777
- var err;
3778
- if (!res) {
3779
- err = new Error('Empty server response');
3780
- }
3781
- else if (res.result_msg === 'KO') {
3782
- err = new Error(res.msg);
3783
- }
3784
- if (err) {
3785
- console.error(err);
3786
- if (displayError) {
3787
- _this.toastr.error(err.message);
3788
- }
3789
- throw new Error(err);
3790
- }
3791
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3792
- })), catchError((/**
3793
- * @param {?} err
3794
- * @return {?}
3795
- */
3796
- function (err) {
3797
- // In a real world app, we might use a remote logging infrastructure
3798
- // We'd also dig deeper into the error to get a better message
3799
- /** @type {?} */
3800
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3801
- console.error(errMsg); // log to console instead
3802
- throw err;
3803
- })));
3804
- };
3805
- /**
3806
- * @return {?}
3807
- */
3808
- AuthenticationService.prototype.checkCredentials_toLogin = /**
3502
+ FHComboboxComponent.prototype.ngAfterViewInit = /**
3809
3503
  * @return {?}
3810
3504
  */
3811
3505
  function () {
3812
- if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
3813
- this.goto_after = window.location.toString();
3814
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
3815
- if (this.router.url.indexOf('/rp/') == -1)
3816
- this.router.navigate(['login']);
3817
- return false;
3818
- }
3819
- return true;
3506
+ // console.log("ngAfterViewInit"); console.log(this.init_fill);
3820
3507
  };
3821
3508
  /**
3822
3509
  * @return {?}
3823
3510
  */
3824
- AuthenticationService.prototype.checkCredentials = /**
3511
+ FHComboboxComponent.prototype.ngOnInit = /**
3825
3512
  * @return {?}
3826
3513
  */
3827
3514
  function () {
3828
- if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
3829
- this.goto_after = window.location.toString();
3830
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
3831
- return false;
3515
+ if (this.init_fill == true) {
3516
+ if (this.sql == '') {
3517
+ //this.errorMsg="QUERY NON CONFIGURATA";
3518
+ return;
3519
+ }
3520
+ this.fillCombo();
3832
3521
  }
3833
- return true;
3834
- };
3835
- AuthenticationService.decorators = [
3836
- { type: Injectable, args: [{
3837
- providedIn: 'root',
3838
- },] }
3839
- ];
3840
- /** @nocollapse */
3841
- AuthenticationService.ctorParameters = function () { return [
3842
- { type: QueryService },
3843
- { type: ToastrService },
3844
- { type: HttpClient },
3845
- { type: Router },
3846
- { type: ActivatedRoute },
3847
- { type: FileService },
3848
- { type: AppService },
3849
- { type: UtilityService }
3850
- ]; };
3851
- /** @nocollapse */ AuthenticationService.ngInjectableDef = defineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(inject(QueryService), inject(ToastrService), inject(HttpClient), inject(Router), inject(ActivatedRoute), inject(FileService), inject(AppService), inject(UtilityService)); }, token: AuthenticationService, providedIn: "root" });
3852
- return AuthenticationService;
3853
- }());
3854
-
3855
- /**
3856
- * @fileoverview added by tsickle
3857
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3858
- */
3859
- var WinAskTextBigComponent = /** @class */ (function () {
3860
- function WinAskTextBigComponent(dialogRef, toastr) {
3861
- this.dialogRef = dialogRef;
3862
- this.toastr = toastr;
3863
- this.title = "";
3864
- this.label = "";
3865
- this.valore = "";
3866
- this.readonly = false;
3867
- this.show_annulla = true;
3868
- this.show_ok = true;
3869
- this.min_chars = 3;
3870
- }
3871
- /**
3872
- * @return {?}
3873
- */
3874
- WinAskTextBigComponent.prototype.ngOnInit = /**
3875
- * @return {?}
3876
- */
3877
- function () {
3878
- };
3879
- /**
3880
- * @return {?}
3881
- */
3882
- WinAskTextBigComponent.prototype.show = /**
3883
- * @return {?}
3884
- */
3885
- function () {
3886
- };
3887
- /**
3888
- * @return {?}
3889
- */
3890
- WinAskTextBigComponent.prototype.hide = /**
3891
- * @return {?}
3892
- */
3893
- function () {
3894
- this.dialogRef.close(null);
3895
- };
3896
- /**
3897
- * @return {?}
3898
- */
3899
- WinAskTextBigComponent.prototype.do_check = /**
3900
- * @return {?}
3901
- */
3902
- function () {
3903
- if (this.valore.length < this.min_chars) {
3904
- this.toastr.error('Il valore deve contenere almeno ' + this.min_chars + ' caratteri');
3905
- return;
3522
+ else {
3523
+ this.errorMsg = "";
3906
3524
  }
3907
- this.dialogRef.close(this.valore);
3525
+ this
3526
+ .initend
3527
+ .emit();
3908
3528
  };
3909
3529
  /**
3910
3530
  * @return {?}
3911
3531
  */
3912
- WinAskTextBigComponent.prototype.chiudi = /**
3532
+ FHComboboxComponent.prototype.sc = /**
3913
3533
  * @return {?}
3914
3534
  */
3915
3535
  function () {
3916
- this.dialogRef.close(null);
3536
+ this
3537
+ .selchange
3538
+ .emit({ event: this.getObj(), valore: this.getValue(), descrizione_valore: this.getDescri() });
3917
3539
  };
3918
- WinAskTextBigComponent.decorators = [
3540
+ FHComboboxComponent.decorators = [
3919
3541
  { type: Component, args: [{
3920
- selector: 'app-win_ask_text',
3921
- template: "\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style=\"width:630px;font-size: 12px;\">\n <mat-form-field appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <textarea matInput [readonly]=\"readonly\" [(ngModel)]=\"valore\" style=\"min-width:600px\" rows=\"15\"\n required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" style=\"width: 100%\">\n\n <button *ngIf=\"show_ok\" mat-flat-button color=\"primary\" (click)=\"do_check()\">OK</button>&nbsp;&nbsp;&nbsp;\n <button *ngIf=\"show_annulla\" mat-flat-button color=\"warn\" (click)=\"chiudi()\">ANNULLA</button>\n </div>\n\n\n "
3542
+ selector: 'FHComboBox', template: "\n <mat-form-field [hidden]=\"!enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <mat-select #cmb [(ngModel)]=\"selval\" (selectionChange)=\"sc()\" [required]=\"required\">\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\n <mat-form-field [hidden]=\"enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input type=\"text\" #el1 matInput [disabled]=\"true\" [(ngModel)]=\"dis_value\">\n </mat-form-field>\n ",
3543
+ styles: ["\n\n "]
3922
3544
  }] }
3923
3545
  ];
3924
3546
  /** @nocollapse */
3925
- WinAskTextBigComponent.ctorParameters = function () { return [
3926
- { type: MatDialogRef },
3927
- { type: ToastrService }
3547
+ FHComboboxComponent.ctorParameters = function () { return [
3548
+ { type: QueryService },
3549
+ { type: OdbcService }
3928
3550
  ]; };
3929
- WinAskTextBigComponent.propDecorators = {
3930
- title: [{ type: Input }],
3551
+ FHComboboxComponent.propDecorators = {
3552
+ init_fill: [{ type: Input }],
3553
+ sql: [{ type: Input }],
3554
+ types: [{ type: Input }],
3555
+ values: [{ type: Input }],
3556
+ hidden: [{ type: Input }],
3931
3557
  label: [{ type: Input }],
3932
- valore: [{ type: Input }],
3933
- readonly: [{ type: Input }],
3934
- show_annulla: [{ type: Input }],
3935
- show_ok: [{ type: Input }]
3558
+ enabled: [{ type: Input }],
3559
+ required: [{ type: Input }],
3560
+ sel_label: [{ type: Input }],
3561
+ smtr: [{ type: ViewChild, args: ['cmb',] }],
3562
+ fillend: [{ type: Output }],
3563
+ selchange: [{ type: Output }],
3564
+ initend: [{ type: Output }],
3565
+ valDef: [{ type: Input }],
3566
+ db_type: [{ type: Input }]
3936
3567
  };
3937
- return WinAskTextBigComponent;
3568
+ return FHComboboxComponent;
3938
3569
  }());
3939
3570
 
3940
3571
  /**
3941
3572
  * @fileoverview added by tsickle
3942
3573
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3943
3574
  */
3944
- var FHUploadPanelComponent = /** @class */ (function () {
3945
- function FHUploadPanelComponent(_appservice, _dataService, toastr, dialog, auth_s, uti) {
3946
- this._appservice = _appservice;
3575
+ var FHUploadComponent = /** @class */ (function () {
3576
+ function FHUploadComponent(_dataService, toastr, dialog, app_s) {
3577
+ var _this = this;
3947
3578
  this._dataService = _dataService;
3948
3579
  this.toastr = toastr;
3949
3580
  this.dialog = dialog;
3950
- this.auth_s = auth_s;
3951
- this.uti = uti;
3581
+ this.app_s = app_s;
3582
+ this.show_descri = true;
3952
3583
  this.enabled = true;
3953
- this.label = '';
3954
- this.sovrascrivi_path = '';
3955
- this.ruolo_supervisore = '[ZZZ_DIS_CC]';
3956
- this.access_control = false;
3957
- this.show_images = true;
3958
- this.change = new EventEmitter();
3959
- this.App = '';
3960
- this.K = '';
3961
- this.image_type = false;
3584
+ this.single = true;
3585
+ this.descri_obb = false;
3586
+ this.programma_da_eseguire = '';
3587
+ this.label_attendere = 'ATTENDERE UPLOAD IN CORSO';
3588
+ this.fixed_label = ' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)';
3589
+ this.limit_string = 'Il file di <size>MB supera il limite di 500MB';
3590
+ this.allegato_inserito = 'ALLEGATO INSERITO';
3591
+ this.inserire_descrizione = 'Descrizione Obbligatoria';
3592
+ this.lista_allegati = [];
3593
+ this.change = new EventEmitter();
3594
+ this.upload_ended = new EventEmitter();
3595
+ this.multi_list = false;
3596
+ this.allow_delete = false;
3597
+ this.loading = false;
3598
+ this.App = '';
3599
+ this.K = '';
3600
+ this.label_b = "";
3601
+ this.descrizione = '';
3602
+ this.file_name = '';
3603
+ this.label = '';
3604
+ this.username = '';
3962
3605
  this.b_edit_loaded = false;
3963
- this.b_False = false;
3964
- this.b_mobile = false;
3606
+ this.tipo = '';
3965
3607
  this.b_ini = false;
3966
- this.m_p_tipo = "";
3967
- this.m_programma_da_eseguire = "";
3968
- }
3969
- /**
3970
- * @param {?} ax
3971
- * @return {?}
3972
- */
3973
- FHUploadPanelComponent.prototype.download_all = /**
3974
- * @param {?} ax
3975
- * @return {?}
3976
- */
3977
- function (ax) {
3978
- if (ax.APP != null)
3979
- ax.App = ax.APP;
3980
- if (this.sovrascrivi_path == '') {
3981
- window.open(this._appservice.COMPANY_SITE_ROOT + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
3982
- }
3983
- else {
3984
- window.open(this.sovrascrivi_path + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
3985
- }
3986
- };
3987
- /**
3988
- * @param {?} ax
3989
- * @return {?}
3990
- */
3991
- FHUploadPanelComponent.prototype.edit_descri = /**
3992
- * @param {?} ax
3993
- * @return {?}
3994
- */
3995
- function (ax) {
3996
- var _this = this;
3997
- /** @type {?} */
3998
- var dialogRef = this
3999
- .dialog
4000
- .open(WinAskTextBigComponent);
4001
- dialogRef.componentInstance.label = "Descrizione Allegato";
4002
- dialogRef.componentInstance.valore = ax.descrizione;
4003
- dialogRef.componentInstance.min_chars = 0;
4004
- dialogRef
4005
- .afterClosed()
4006
- .subscribe((/**
4007
- * @param {?} result
3608
+ this.uploader = new FileUploader({
3609
+ url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT,
3610
+ 'maxFileSize': 500 * 1024 * 1024
3611
+ });
3612
+ this.id = null;
3613
+ this.username = this.app_s.user;
3614
+ this.uploader.onBeforeUploadItem = (/**
3615
+ * @param {?} item
4008
3616
  * @return {?}
4009
3617
  */
4010
- function (result) {
4011
- if (result != null) {
4012
- /** @type {?} */
4013
- var p = new QParam();
4014
- p.sql = "UPDATE_ALLEGATI_DESCRIZIONE";
4015
- p.types = ['int', 'string'];
4016
- p.values = [ax.id, result];
4017
- _this
4018
- ._dataService
4019
- .doQuery(p)
4020
- .subscribe((/**
4021
- * @param {?} data
4022
- * @return {?}
4023
- */
4024
- function (data) {
4025
- if (data != null)
4026
- if (data.result_msg == "OK") {
4027
- _this.ref_allegato();
4028
- }
4029
- }));
3618
+ function (item) {
3619
+ item.withCredentials = false;
3620
+ });
3621
+ this.uploader.onCompleteItem = (/**
3622
+ * @param {?} item
3623
+ * @param {?} response
3624
+ * @param {?} status
3625
+ * @param {?} header
3626
+ * @return {?}
3627
+ */
3628
+ function (item, response, status, header) {
3629
+ if (status === 200) {
3630
+ _this.descrizione = '';
3631
+ _this.toastr.info("INFO", _this.allegato_inserito, {
3632
+ timeOut: 1000,
3633
+ progressBar: true
3634
+ });
3635
+ _this.ref_allegato();
3636
+ _this.change.emit({ item: item, response: response, status: status, header: header });
4030
3637
  }
4031
- }));
4032
- };
3638
+ });
3639
+ }
4033
3640
  /**
4034
- * @param {?} ax
4035
3641
  * @return {?}
4036
3642
  */
4037
- FHUploadPanelComponent.prototype.delete = /**
4038
- * @param {?} ax
3643
+ FHUploadComponent.prototype.del_doc = /**
4039
3644
  * @return {?}
4040
3645
  */
4041
- function (ax) {
3646
+ function () {
4042
3647
  var _this = this;
4043
- localStorage.setItem(this._appservice.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
4044
- localStorage.setItem(this._appservice.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
3648
+ localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
3649
+ localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
4045
3650
  /** @type {?} */
4046
3651
  var dialogRef = this
4047
3652
  .dialog
@@ -4058,7 +3663,7 @@ var FHUploadPanelComponent = /** @class */ (function () {
4058
3663
  var p = new QParam();
4059
3664
  p.sql = "DELETE_ALLEGATO";
4060
3665
  p.types = ['int', 'string'];
4061
- p.values = [ax.id, _this.auth_s.username];
3666
+ p.values = [_this.id, _this.app_s.user];
4062
3667
  _this
4063
3668
  ._dataService
4064
3669
  .doQuery(p)
@@ -4090,183 +3695,552 @@ var FHUploadPanelComponent = /** @class */ (function () {
4090
3695
  /**
4091
3696
  * @return {?}
4092
3697
  */
4093
- FHUploadPanelComponent.prototype.ngOnInit = /**
3698
+ FHUploadComponent.prototype.load_types = /**
4094
3699
  * @return {?}
4095
3700
  */
4096
3701
  function () {
4097
- this.upc.single = false;
4098
- this.b_mobile = this._appservice.getState().pageFullscreen;
4099
- this
4100
- .upc
4101
- .init(this.App, this.K, 'Descrizione Allegato', this.m_p_tipo, this.m_programma_da_eseguire);
4102
- this.ref_allegato();
3702
+ var _this = this;
3703
+ if (this.cmb_tipo == null) {
3704
+ setTimeout((/**
3705
+ * @return {?}
3706
+ */
3707
+ function () { _this.load_types(); }), 200);
3708
+ return;
3709
+ }
3710
+ this.cmb_tipo.fillCombo();
4103
3711
  };
4104
3712
  /**
4105
- * @param {?} p_app
4106
- * @param {?} p_k
4107
- * @param {?=} p_tipo
4108
- * @param {?=} programma_da_eseguire
4109
3713
  * @return {?}
4110
3714
  */
4111
- FHUploadPanelComponent.prototype.init = /**
4112
- * @param {?} p_app
4113
- * @param {?} p_k
4114
- * @param {?=} p_tipo
4115
- * @param {?=} programma_da_eseguire
3715
+ FHUploadComponent.prototype.ngOnInit = /**
4116
3716
  * @return {?}
4117
3717
  */
4118
- function (p_app, p_k, p_tipo, programma_da_eseguire) {
4119
- if (p_tipo === void 0) { p_tipo = ""; }
4120
- if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
4121
- this.App = p_app;
4122
- this.K = p_k;
4123
- this.b_ini = true;
4124
- this.b_edit_loaded = false;
4125
- this.m_p_tipo = p_tipo;
4126
- this.m_programma_da_eseguire = programma_da_eseguire;
4127
- this.ngOnInit();
3718
+ function () {
3719
+ var _this = this;
3720
+ /** @type {?} */
3721
+ var uo = {};
3722
+ uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
3723
+ // console.log('ngOnInit!!');
3724
+ this.uploader.setOptions(uo);
3725
+ this.uploader.onCompleteAll = (/**
3726
+ * @return {?}
3727
+ */
3728
+ function () {
3729
+ _this.loading = false;
3730
+ _this.upload_ended.emit();
3731
+ if (_this.dialogRef != null)
3732
+ if (_this.dialogRef.componentInstance != null) {
3733
+ _this.dialogRef.componentInstance.update_progess(100);
3734
+ _this.dialogRef = null;
3735
+ }
3736
+ });
3737
+ this.uploader.onErrorItem = (/**
3738
+ * @param {?} a
3739
+ * @param {?} b
3740
+ * @param {?} c
3741
+ * @param {?} d
3742
+ * @return {?}
3743
+ */
3744
+ function (a, b, c, d) {
3745
+ _this.toastr.error(b);
3746
+ });
3747
+ this.uploader.onAfterAddingFile = (/**
3748
+ * @param {?} fileItem
3749
+ * @return {?}
3750
+ */
3751
+ function (fileItem) {
3752
+ _this.ch(fileItem);
3753
+ });
3754
+ this.uploader.onProgressItem = (/**
3755
+ * @param {?} fileItem
3756
+ * @param {?} progress
3757
+ * @return {?}
3758
+ */
3759
+ function (fileItem, progress) {
3760
+ // console.log(fileItem);
3761
+ // console.log(progress);
3762
+ _this.loading = true;
3763
+ if (_this.dialogRef != null)
3764
+ if (_this.dialogRef.componentInstance != null)
3765
+ _this.dialogRef.componentInstance.update_progess(progress);
3766
+ });
3767
+ this.uploader.onWhenAddingFileFailed = (/**
3768
+ * @param {?} item
3769
+ * @param {?} filter
3770
+ * @param {?} options
3771
+ * @return {?}
3772
+ */
3773
+ function (item, filter, options) {
3774
+ switch (filter.name) {
3775
+ case 'fileSize':
3776
+ /** @type {?} */
3777
+ var ar = Math.round(item.size / 1024 / 1024);
3778
+ _this.toastr.error(_this.limit_string.split('<size>').join('' + ar));
3779
+ break;
3780
+ default:
3781
+ _this.toastr.error("Errore: " + filter.name);
3782
+ }
3783
+ });
4128
3784
  };
4129
3785
  /**
4130
3786
  * @return {?}
4131
3787
  */
4132
- FHUploadPanelComponent.prototype.ref_allegato = /**
3788
+ FHUploadComponent.prototype.download_all = /**
4133
3789
  * @return {?}
4134
3790
  */
4135
3791
  function () {
3792
+ window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + this.App + '/' + this.K + '/' + this.file_name);
3793
+ };
3794
+ /**
3795
+ * @param {?} fileItem
3796
+ * @return {?}
3797
+ */
3798
+ FHUploadComponent.prototype.ch = /**
3799
+ * @param {?} fileItem
3800
+ * @return {?}
3801
+ */
3802
+ function (fileItem) {
4136
3803
  var _this = this;
4137
- if (this.App == null)
4138
- return;
4139
- if (this.App == "")
3804
+ if (this.descri_obb && this.descrizione == '') {
3805
+ this.toastr.error(this.inserire_descrizione);
4140
3806
  return;
4141
- /** @type {?} */
4142
- var p = new QParam();
4143
- p.sql = "SELECT_ALLEGATO_INFO";
4144
- p.types = ['string', 'string'];
4145
- p.values = [this.App, this.K];
4146
- this
4147
- ._dataService
4148
- .doQuery(p)
4149
- .subscribe((/**
4150
- * @param {?} data
4151
- * @return {?}
4152
- */
3807
+ }
3808
+ for (var i = 0; i < this.lista_allegati.length; i++) {
3809
+ if (this.lista_allegati[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
3810
+ this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
3811
+ return;
3812
+ }
3813
+ }
3814
+ this.uploader.onBuildItemForm = (/**
3815
+ * @param {?} item
3816
+ * @param {?} form
3817
+ * @return {?}
3818
+ */
3819
+ function (item, form) {
3820
+ form.append('App', _this.App);
3821
+ form.append('K', _this.K);
3822
+ form.append('descrizione', _this.descrizione);
3823
+ form.append('single', _this.single);
3824
+ form.append('username', _this.username);
3825
+ if (_this.multi_list)
3826
+ form.append('tipo', _this.cmb_tipo.getDescri().split('-1').join(''));
3827
+ else
3828
+ form.append('tipo', _this.tipo);
3829
+ form.append('local_path', _this.app_s.LOCAL_PATH);
3830
+ if (_this.programma_da_eseguire != '')
3831
+ form.append('p1', _this.programma_da_eseguire);
3832
+ });
3833
+ if (this.dialogRef == null) {
3834
+ this.dialogRef = this.dialog.open(WinWait, { 'disableClose': true });
3835
+ this.dialogRef.componentInstance.label = this.label_attendere;
3836
+ this.dialogRef.afterClosed().subscribe((/**
3837
+ * @param {?} result
3838
+ * @return {?}
3839
+ */
3840
+ function (result) {
3841
+ }));
3842
+ }
3843
+ this.uploader.uploadAll();
3844
+ };
3845
+ /**
3846
+ * @param {?} p_app
3847
+ * @param {?} p_k
3848
+ * @param {?} p_label
3849
+ * @param {?=} p_tipo
3850
+ * @param {?=} programma_da_eseguire
3851
+ * @param {?=} allow_delete
3852
+ * @return {?}
3853
+ */
3854
+ FHUploadComponent.prototype.init = /**
3855
+ * @param {?} p_app
3856
+ * @param {?} p_k
3857
+ * @param {?} p_label
3858
+ * @param {?=} p_tipo
3859
+ * @param {?=} programma_da_eseguire
3860
+ * @param {?=} allow_delete
3861
+ * @return {?}
3862
+ */
3863
+ function (p_app, p_k, p_label, p_tipo, programma_da_eseguire, allow_delete) {
3864
+ if (p_tipo === void 0) { p_tipo = ""; }
3865
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
3866
+ if (allow_delete === void 0) { allow_delete = false; }
3867
+ this.App = p_app;
3868
+ this.K = p_k;
3869
+ this.label = p_label;
3870
+ this.tipo = p_tipo;
3871
+ this.b_ini = true;
3872
+ this.b_edit_loaded = false;
3873
+ this.descrizione = '';
3874
+ this.programma_da_eseguire = programma_da_eseguire;
3875
+ this.allow_delete = allow_delete;
3876
+ this.ref_allegato();
3877
+ // console.log('init! ',this.tipo)
3878
+ if (this.tipo.indexOf('SELECT_') > -1) {
3879
+ this.multi_list = true;
3880
+ this.load_types();
3881
+ //console.log('fillCombo');
3882
+ }
3883
+ };
3884
+ /**
3885
+ * @return {?}
3886
+ */
3887
+ FHUploadComponent.prototype.ref_allegato = /**
3888
+ * @return {?}
3889
+ */
3890
+ function () {
3891
+ var _this = this;
3892
+ // console.log(' ref_allegato')
3893
+ this.id = null;
3894
+ this.descrizione = '';
3895
+ this.file_name = '';
3896
+ this.label_b = '';
3897
+ this.cmb_tipo.resetValue();
3898
+ if (!this.single)
3899
+ return;
3900
+ if (this.App == null)
3901
+ return;
3902
+ if (this.App == "")
3903
+ return;
3904
+ /** @type {?} */
3905
+ var p = new QParam();
3906
+ p.sql = "SELECT_ALLEGATO_INFO";
3907
+ p.types = ['string', 'string'];
3908
+ p.values = [this.App, this.K];
3909
+ this._dataService.doQuery(p).subscribe((/**
3910
+ * @param {?} data
3911
+ * @return {?}
3912
+ */
4153
3913
  function (data) {
4154
3914
  if (data != null)
4155
3915
  if (data.result_msg == "OK") {
4156
- _this.arr_g = data.result_data;
4157
3916
  /** @type {?} */
4158
- var iconf = "webinfo";
4159
- for (var i = 0; i < _this.arr_g.length; i++) {
4160
- if (_this.arr_g[i].APP != null)
4161
- _this.arr_g[i].App = _this.arr_g[i].APP;
4162
- if (_this.arr_g[i].descrizione != null)
4163
- _this.arr_g[i].descrizione_vis = _this.arr_g[i].descrizione.split('\n').join('<br>');
4164
- else
4165
- _this.arr_g[i].descrizione_vis = '';
4166
- /** @type {?} */
4167
- var arrf = _this.arr_g[i].Filename.split('.');
4168
- if (_this.sovrascrivi_path == '') {
4169
- _this.arr_g[i].url = _this._appservice.COMPANY_SITE_ROOT + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4170
- _this.arr_g[i].url_orig = _this._appservice.COMPANY_SITE_ROOT + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4171
- }
4172
- else {
4173
- _this.arr_g[i].url = _this.sovrascrivi_path + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4174
- _this.arr_g[i].url_orig = _this.sovrascrivi_path + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4175
- }
4176
- if ('3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH'.indexOf(arrf[arrf.length - 1].toLocaleUpperCase()) != -1)
4177
- iconf = arrf[arrf.length - 1].toLocaleLowerCase();
4178
- _this.arr_g[i].icon = iconf + '.svg';
4179
- _this.arr_g[i].can_delete = !_this.access_control || _this.arr_g[i].idp == _this._appservice.user || _this.uti.hasRole(_this.ruolo_supervisore);
4180
- if ((_this.arr_g[i].Filename.indexOf(".jpg") != -1 || _this.arr_g[i].Filename.indexOf(".gif") != -1 || _this.arr_g[i].Filename.indexOf(".png") != -1) && _this.show_images) {
4181
- _this.arr_g[i].type = "IMG";
4182
- _this.arr_g[i].image_original = [_this.arr_g[i].url];
4183
- if (_this.arr_g[i].preview != null)
4184
- if (_this.arr_g[i].preview == 1) {
4185
- /** @type {?} */
4186
- var pcs = _this.arr_g[i].url.split('.');
4187
- /** @type {?} */
4188
- var lastPc = pcs.pop();
4189
- _this.arr_g[i].url = pcs.join('.') + '_preview.' + lastPc;
4190
- }
4191
- _this.image_type = true;
4192
- _this.arr_g[i].image_thumbnail = [_this.arr_g[i].url];
4193
- }
4194
- else
4195
- _this.arr_g[i].type = "O";
3917
+ var a = data.result_data;
3918
+ if (a.length > 0) {
3919
+ _this.id = a[0].id;
3920
+ _this.descrizione = a[0].descrizione;
3921
+ _this.file_name = a[0].Filename;
3922
+ _this.label_b = "" + a[0].Filename + " - " + a[0].Filesize + "";
3923
+ _this.b_edit_loaded = true;
4196
3924
  }
4197
3925
  }
4198
3926
  }));
4199
3927
  };
4200
- FHUploadPanelComponent.decorators = [
3928
+ FHUploadComponent.decorators = [
4201
3929
  { type: Component, args: [{
4202
- selector: 'FHUploadPanel', template: "\n <div fxLayout=\"column\">\n <h3>{{label}}</h3>\n <div fxLayout=\"column\">\n <div [hidden]=\"!enabled\">\n <FHUpload [single]=\"b_False\" [lista_allegati]=\"arr_g\" (change)=\"ref_allegato()\" #upc></FHUpload>\n </div>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"!image_type && !b_mobile\">\n <thead>\n <tr class=\"header\">\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">Nome</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n <th style=\"width:50%\">Descrizione</th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th style=\"width:30%\" >Utente</th>\n <th style=\"width:240px;text-align:center\">Data</th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;\" style=\"font-size: 12px;\" [ngClass]=\"{ odd: odd, even: even }\">\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n <td>{{app.Filename}}</td>\n <td style=\"text-align:center\">{{app.Filesize}}</td>\n <td>\n <div fxLayout=\"row\">\n <a mat-icon-button matTooltip=\"Modifica Descrizione\" *ngIf=\"app.can_delete\" (click)=\"edit_descri(app)\">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Modifica Descrizione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]=\"app.descrizione_vis\" style=\"width:100%\">\n </div>\n </div></td>\n\n\n <td style=\"min-width:400px;min-height: 400px\" *ngIf=\"app.type=='IMG'\">\n <fh-image-viewer [u]=\"app\"></fh-image-viewer>\n\n </td>\n <td *ngIf=\"app.type!='IMG'\">\n\n </td>\n <td>{{app.nc}}</td>\n <td style=\"text-align:center\">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>\n <td style=\"text-align:center\">\n <button mat-icon-button matTooltip=\"Download File\" (click)=\"download_all(app)\">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a mat-icon-button matTooltip=\"Elimina File\" *ngIf=\"app.can_delete\" (click)=\"delete(app)\">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Cancellazione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"image_type && !b_mobile\">\n <thead>\n <tr class=\"header\">\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">Nome</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n\n <th style=\"width:20%\">Descrizione</th>\n\n <th style=\"width:40%\" ></th>\n\n\n <th style=\"width:10%\" >Utente</th>\n <th style=\"width:240px;text-align:center\">Data</th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;\" style=\"font-size: 12px;\" [ngClass]=\"{ odd: odd, even: even }\">\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n\n <td>{{app.Filename}}</td>\n <td style=\"text-align:center\">{{app.Filesize}}</td>\n <td>\n <div fxLayout=\"row\">\n <a mat-icon-button matTooltip=\"Modifica Descrizione\" *ngIf=\"app.can_delete\" (click)=\"edit_descri(app)\">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Modifica Descrizione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]=\"app.descrizione_vis\" style=\"width:100%\">\n </div>\n </div></td>\n\n\n <td style=\"min-width:400px;min-height: 400px\" *ngIf=\"app.type=='IMG'\">\n <fh-image-viewer [u]=\"app\"></fh-image-viewer>\n\n </td>\n <td *ngIf=\"app.type!='IMG'\">\n\n </td>\n <td>{{app.nc}}</td>\n <td style=\"text-align:center\">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>\n <td style=\"text-align:center\">\n <button mat-icon-button matTooltip=\"Download File\" (click)=\"download_all(app)\">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a mat-icon-button matTooltip=\"Elimina File\" *ngIf=\"app.can_delete\" (click)=\"delete(app)\">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Cancellazione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"b_mobile\">\n <tbody>\n\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;\" style=\"font-size: 12px;\" [ngClass]=\"{ odd: odd, even: even }\">\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n <td *ngIf=\"b_mobile\" style=\"text-align:center\">{{app.Filename}}<br><br>\n <button style=\"background-color: #F5F5F5\" (click)=\"download_all(app)\" mat-flat-button>DOWNLOAD</button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf=\"!b_ini\" style=\"color:#ff0000\"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ",
4203
- styles: ["\n\n\n\n "]
3930
+ selector: 'FHUpload',
3931
+ template: "\n\n <div *ngIf=\"loading\" fxLayout=\"row\">\n WAIT\n </div>\n <div [hidden]=\"!(enabled && !loading)\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <div [hidden]=\"!multi_list\" style=\"width:380px\" fxLayoutAlign=\"start center\">\n <FHComboBox [sql]=\"tipo\" #cmb_tipo [init_fill]=\"false\" label=\"Tipologia\"></FHComboBox>&nbsp;&nbsp;\n </div>\n <mat-form-field [hidden]=\"!show_descri\" style=\"width: 100%\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}} {{fixed_label}}</mat-label>\n <input matInput type=\"text\" name=\"descrizione\" [(ngModel)]=\"descrizione\"\n >\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div style=\"width:140px\" fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <input type=\"file\" multiple ng2FileSelect [uploader]=\"uploader\" name=\"file-fh{{App}}\" id=\"file-fh{{App}}\" class=\"inputfile inputfile-fh\" />\n <label for=\"file-fh{{App}}\" style=\"width:210px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"17\" viewBox=\"0 0 20 17\"><path d=\"M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z\"/></svg><span style=\"font-size: 12px\">&nbsp;&nbsp;&nbsp;Upload</span></label>\n </div>\n <div fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <button mat-flat-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\" style=\"font-size: 12px\">{{label_b}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button *ngIf=\"id!=null && allow_delete\" (click)=\"del_doc()\" color=\"warn\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf=\"!enabled\" fxLayout=\"row\">\n <label>{{label}}:</label>{{descrizione}}\n <button mat-flat-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\" style=\"font-size: 12px;background-color: #F5F5F5\">{{label_b}}</button>\n\n </div>\n\n ",
3932
+ styles: ["\n\n "]
4204
3933
  }] }
4205
3934
  ];
4206
3935
  /** @nocollapse */
4207
- FHUploadPanelComponent.ctorParameters = function () { return [
4208
- { type: AppService },
3936
+ FHUploadComponent.ctorParameters = function () { return [
4209
3937
  { type: QueryService },
4210
3938
  { type: ToastrService },
4211
3939
  { type: MatDialog },
4212
- { type: AuthenticationService },
4213
- { type: UtilityService }
3940
+ { type: AppService }
4214
3941
  ]; };
4215
- FHUploadPanelComponent.propDecorators = {
3942
+ FHUploadComponent.propDecorators = {
3943
+ show_descri: [{ type: Input }],
4216
3944
  enabled: [{ type: Input }],
4217
- label: [{ type: Input }],
4218
- sovrascrivi_path: [{ type: Input }],
4219
- ruolo_supervisore: [{ type: Input }],
4220
- access_control: [{ type: Input }],
4221
- show_images: [{ type: Input }],
3945
+ single: [{ type: Input }],
3946
+ descri_obb: [{ type: Input }],
3947
+ programma_da_eseguire: [{ type: Input }],
3948
+ label_attendere: [{ type: Input }],
3949
+ fixed_label: [{ type: Input }],
3950
+ limit_string: [{ type: Input }],
3951
+ allegato_inserito: [{ type: Input }],
3952
+ inserire_descrizione: [{ type: Input }],
3953
+ lista_allegati: [{ type: Input }],
4222
3954
  change: [{ type: Output }],
4223
- upc: [{ type: ViewChild, args: ['upc',] }]
3955
+ upload_ended: [{ type: Output }],
3956
+ cmb_tipo: [{ type: ViewChild, args: ['cmb_tipo',] }]
3957
+ };
3958
+ return FHUploadComponent;
3959
+ }());
3960
+
3961
+ /**
3962
+ * @fileoverview added by tsickle
3963
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3964
+ */
3965
+ var AuthenticationService = /** @class */ (function () {
3966
+ function AuthenticationService(_dataService, toastr, http, router, route, _fileService, app_s, uti_s) {
3967
+ this._dataService = _dataService;
3968
+ this.toastr = toastr;
3969
+ this.http = http;
3970
+ this.router = router;
3971
+ this.route = route;
3972
+ this._fileService = _fileService;
3973
+ this.app_s = app_s;
3974
+ this.uti_s = uti_s;
3975
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3976
+ this.goto_after = "";
3977
+ this.username = '';
3978
+ this.headers = new HttpHeaders({
3979
+ 'Content-Type': 'application/json',
3980
+ });
3981
+ }
3982
+ /**
3983
+ * @return {?}
3984
+ */
3985
+ AuthenticationService.prototype.logout = /**
3986
+ * @return {?}
3987
+ */
3988
+ function () {
3989
+ this.app_s.user = null;
3990
+ this.app_s.user_name = null;
3991
+ this.app_s.user_surname = null;
3992
+ this.app_s.user_idp = null;
3993
+ this.app_s.user_email = null;
3994
+ this.app_s.user_roles = null;
3995
+ this.app_s.user_lang = null;
3996
+ this.app_s.user_isadmin = null;
3997
+ this.app_s.token = null;
3998
+ localStorage.removeItem(this.app_s.COMPANY_KEY + "token");
3999
+ if (this.app_s.LOGIN_EXT != 1)
4000
+ this.router.navigate(['login']);
4001
+ else {
4002
+ window.location.href = (this.app_s.LOGOUT_URL_EXT);
4003
+ }
4004
+ };
4005
+ /**
4006
+ * @param {?} username
4007
+ * @param {?} password
4008
+ * @param {?=} displayError
4009
+ * @return {?}
4010
+ */
4011
+ AuthenticationService.prototype.login = /**
4012
+ * @param {?} username
4013
+ * @param {?} password
4014
+ * @param {?=} displayError
4015
+ * @return {?}
4016
+ */
4017
+ function (username, password, displayError) {
4018
+ var _this = this;
4019
+ if (displayError === void 0) { displayError = true; }
4020
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
4021
+ /** @type {?} */
4022
+ var post_v = JSON.stringify({ username: username, password: password });
4023
+ if (this.app_s.LDAP_AUTH == 1)
4024
+ post_v = JSON.stringify({ username: username, password: password, ldap_auth: 1 });
4025
+ return this.http.post(this.url, post_v, {
4026
+ headers: this.headers
4027
+ }).pipe(map((/**
4028
+ * @param {?} res
4029
+ * @return {?}
4030
+ */
4031
+ function (res) {
4032
+ // Handle errors, display if enabled
4033
+ /** @type {?} */
4034
+ var err;
4035
+ if (!res) {
4036
+ err = new Error('Empty server response');
4037
+ }
4038
+ else if (res.result_msg === 'KO') {
4039
+ err = new Error(res.msg);
4040
+ }
4041
+ else {
4042
+ if (res.result_data.length > 0) {
4043
+ localStorage.setItem(_this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
4044
+ }
4045
+ }
4046
+ if (err) {
4047
+ console.error(err);
4048
+ if (displayError) {
4049
+ _this.toastr.error(err.message);
4050
+ }
4051
+ throw new Error(err);
4052
+ }
4053
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4054
+ })), catchError((/**
4055
+ * @param {?} err
4056
+ * @return {?}
4057
+ */
4058
+ function (err) {
4059
+ // In a real world app, we might use a remote logging infrastructure
4060
+ // We'd also dig deeper into the error to get a better message
4061
+ /** @type {?} */
4062
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4063
+ console.error(errMsg); // log to console instead
4064
+ throw err;
4065
+ })));
4066
+ };
4067
+ /**
4068
+ * @param {?} username
4069
+ * @param {?=} displayError
4070
+ * @return {?}
4071
+ */
4072
+ AuthenticationService.prototype.get_user_info = /**
4073
+ * @param {?} username
4074
+ * @param {?=} displayError
4075
+ * @return {?}
4076
+ */
4077
+ function (username, displayError) {
4078
+ var _this = this;
4079
+ if (displayError === void 0) { displayError = true; }
4080
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
4081
+ /** @type {?} */
4082
+ var post_v = JSON.stringify({ username_info: username });
4083
+ return this.http.post(this.url, post_v, {
4084
+ headers: this.headers
4085
+ }).pipe(map((/**
4086
+ * @param {?} res
4087
+ * @return {?}
4088
+ */
4089
+ function (res) {
4090
+ // Handle errors, display if enabled
4091
+ /** @type {?} */
4092
+ var err;
4093
+ if (!res) {
4094
+ err = new Error('Empty server response');
4095
+ }
4096
+ else if (res.result_msg === 'KO') {
4097
+ err = new Error(res.msg);
4098
+ }
4099
+ if (err) {
4100
+ console.error(err);
4101
+ if (displayError) {
4102
+ _this.toastr.error(err.message);
4103
+ }
4104
+ throw new Error(err);
4105
+ }
4106
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4107
+ })), catchError((/**
4108
+ * @param {?} err
4109
+ * @return {?}
4110
+ */
4111
+ function (err) {
4112
+ // In a real world app, we might use a remote logging infrastructure
4113
+ // We'd also dig deeper into the error to get a better message
4114
+ /** @type {?} */
4115
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4116
+ console.error(errMsg); // log to console instead
4117
+ throw err;
4118
+ })));
4119
+ };
4120
+ /**
4121
+ * @param {?} email
4122
+ * @param {?=} displayError
4123
+ * @return {?}
4124
+ */
4125
+ AuthenticationService.prototype.passrecovery = /**
4126
+ * @param {?} email
4127
+ * @param {?=} displayError
4128
+ * @return {?}
4129
+ */
4130
+ function (email, displayError) {
4131
+ var _this = this;
4132
+ if (displayError === void 0) { displayError = true; }
4133
+ /** @type {?} */
4134
+ var post_v = JSON.stringify({ email: email, websiteroot: this.app_s.COMPANY_SITE_ROOT, op: 'send_email' });
4135
+ return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
4136
+ headers: this.headers
4137
+ }).pipe(map((/**
4138
+ * @param {?} res
4139
+ * @return {?}
4140
+ */
4141
+ function (res) {
4142
+ // Handle errors, display if enabled
4143
+ /** @type {?} */
4144
+ var err;
4145
+ if (!res) {
4146
+ err = new Error('Empty server response');
4147
+ }
4148
+ else if (res.result_msg === 'KO') {
4149
+ err = new Error(res.msg);
4150
+ }
4151
+ if (err) {
4152
+ console.error(err);
4153
+ if (displayError) {
4154
+ _this.toastr.error(err.message);
4155
+ }
4156
+ throw new Error(err);
4157
+ }
4158
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4159
+ })), catchError((/**
4160
+ * @param {?} err
4161
+ * @return {?}
4162
+ */
4163
+ function (err) {
4164
+ // In a real world app, we might use a remote logging infrastructure
4165
+ // We'd also dig deeper into the error to get a better message
4166
+ /** @type {?} */
4167
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4168
+ console.error(errMsg); // log to console instead
4169
+ throw err;
4170
+ })));
4171
+ };
4172
+ /**
4173
+ * @param {?} res_rep
4174
+ * @param {?=} displayError
4175
+ * @return {?}
4176
+ */
4177
+ AuthenticationService.prototype.checktoken = /**
4178
+ * @param {?} res_rep
4179
+ * @param {?=} displayError
4180
+ * @return {?}
4181
+ */
4182
+ function (res_rep, displayError) {
4183
+ var _this = this;
4184
+ if (displayError === void 0) { displayError = true; }
4185
+ /** @type {?} */
4186
+ var post_v = JSON.stringify({ res_rep: res_rep, op: 'check_token' });
4187
+ return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
4188
+ headers: this.headers
4189
+ }).pipe(map((/**
4190
+ * @param {?} res
4191
+ * @return {?}
4192
+ */
4193
+ function (res) {
4194
+ // Handle errors, display if enabled
4195
+ /** @type {?} */
4196
+ var err;
4197
+ if (!res) {
4198
+ err = new Error('Empty server response');
4199
+ }
4200
+ else if (res.result_msg === 'KO') {
4201
+ err = new Error(res.msg);
4202
+ }
4203
+ if (err) {
4204
+ console.error(err);
4205
+ if (displayError) {
4206
+ _this.toastr.error(err.message);
4207
+ }
4208
+ throw new Error(err);
4209
+ }
4210
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4211
+ })), catchError((/**
4212
+ * @param {?} err
4213
+ * @return {?}
4214
+ */
4215
+ function (err) {
4216
+ // In a real world app, we might use a remote logging infrastructure
4217
+ // We'd also dig deeper into the error to get a better message
4218
+ /** @type {?} */
4219
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4220
+ console.error(errMsg); // log to console instead
4221
+ throw err;
4222
+ })));
4224
4223
  };
4225
- return FHUploadPanelComponent;
4226
- }());
4227
-
4228
- /**
4229
- * @fileoverview added by tsickle
4230
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4231
- */
4232
- var GridService = /** @class */ (function () {
4233
- function GridService(http, app_s, toastr) {
4234
- this.http = http;
4235
- this.app_s = app_s;
4236
- this.toastr = toastr;
4237
- this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT; // URL to web API
4238
- }
4239
- // URL to web API
4240
4224
  /**
4241
- * @param {?} queryp
4225
+ * @param {?} token
4226
+ * @param {?} password
4242
4227
  * @param {?=} displayError
4243
- * @param {?=} url_sec
4244
4228
  * @return {?}
4245
4229
  */
4246
- GridService.prototype.doQuery =
4247
- // URL to web API
4248
- /**
4249
- * @param {?} queryp
4230
+ AuthenticationService.prototype.change_password = /**
4231
+ * @param {?} token
4232
+ * @param {?} password
4250
4233
  * @param {?=} displayError
4251
- * @param {?=} url_sec
4252
4234
  * @return {?}
4253
4235
  */
4254
- function (queryp, displayError, url_sec) {
4236
+ function (token, password, displayError) {
4255
4237
  var _this = this;
4256
4238
  if (displayError === void 0) { displayError = true; }
4257
- if (url_sec === void 0) { url_sec = null; }
4258
- this.headers = new HttpHeaders({
4259
- 'Content-Type': 'application/json',
4260
- 'Authorization': 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
4261
- });
4262
- if (url_sec == null)
4263
- this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT;
4264
- else
4265
- this.url = url_sec;
4266
4239
  /** @type {?} */
4267
- var post_v = JSON.stringify(queryp);
4268
- return this.http.post(this.url, post_v, { headers: this.headers })
4269
- .pipe(map((/**
4240
+ var post_v = JSON.stringify({ token: token, password: password, op: 'change_password' });
4241
+ return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
4242
+ headers: this.headers
4243
+ }).pipe(map((/**
4270
4244
  * @param {?} res
4271
4245
  * @return {?}
4272
4246
  */
@@ -4301,494 +4275,689 @@ var GridService = /** @class */ (function () {
4301
4275
  throw err;
4302
4276
  })));
4303
4277
  };
4304
- GridService.decorators = [
4278
+ /**
4279
+ * @return {?}
4280
+ */
4281
+ AuthenticationService.prototype.checkCredentials_toLogin = /**
4282
+ * @return {?}
4283
+ */
4284
+ function () {
4285
+ if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
4286
+ this.goto_after = window.location.toString();
4287
+ if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
4288
+ if (this.router.url.indexOf('/rp/') == -1)
4289
+ this.router.navigate(['login']);
4290
+ return false;
4291
+ }
4292
+ return true;
4293
+ };
4294
+ /**
4295
+ * @return {?}
4296
+ */
4297
+ AuthenticationService.prototype.checkCredentials = /**
4298
+ * @return {?}
4299
+ */
4300
+ function () {
4301
+ if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
4302
+ this.goto_after = window.location.toString();
4303
+ if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
4304
+ return false;
4305
+ }
4306
+ return true;
4307
+ };
4308
+ AuthenticationService.decorators = [
4305
4309
  { type: Injectable, args: [{
4306
4310
  providedIn: 'root',
4307
4311
  },] }
4308
4312
  ];
4309
4313
  /** @nocollapse */
4310
- GridService.ctorParameters = function () { return [
4314
+ AuthenticationService.ctorParameters = function () { return [
4315
+ { type: QueryService },
4316
+ { type: ToastrService },
4311
4317
  { type: HttpClient },
4318
+ { type: Router },
4319
+ { type: ActivatedRoute },
4320
+ { type: FileService },
4312
4321
  { type: AppService },
4313
- { type: ToastrService }
4322
+ { type: UtilityService }
4314
4323
  ]; };
4315
- /** @nocollapse */ GridService.ngInjectableDef = defineInjectable({ factory: function GridService_Factory() { return new GridService(inject(HttpClient), inject(AppService), inject(ToastrService)); }, token: GridService, providedIn: "root" });
4316
- return GridService;
4324
+ /** @nocollapse */ AuthenticationService.ngInjectableDef = defineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(inject(QueryService), inject(ToastrService), inject(HttpClient), inject(Router), inject(ActivatedRoute), inject(FileService), inject(AppService), inject(UtilityService)); }, token: AuthenticationService, providedIn: "root" });
4325
+ return AuthenticationService;
4317
4326
  }());
4318
4327
 
4319
4328
  /**
4320
4329
  * @fileoverview added by tsickle
4321
4330
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4322
4331
  */
4323
- var win_grid_help = /** @class */ (function () {
4324
- function win_grid_help(dialogRef, toastr, m_appService) {
4332
+ var WinAskTextBigComponent = /** @class */ (function () {
4333
+ function WinAskTextBigComponent(dialogRef, toastr) {
4325
4334
  this.dialogRef = dialogRef;
4326
4335
  this.toastr = toastr;
4327
- this.m_appService = m_appService;
4328
4336
  this.title = "";
4337
+ this.label = "";
4338
+ this.valore = "";
4339
+ this.readonly = false;
4340
+ this.show_annulla = true;
4341
+ this.show_ok = true;
4342
+ this.min_chars = 3;
4329
4343
  }
4330
4344
  /**
4331
4345
  * @return {?}
4332
4346
  */
4333
- win_grid_help.prototype.ngOnInit = /**
4347
+ WinAskTextBigComponent.prototype.ngOnInit = /**
4334
4348
  * @return {?}
4335
4349
  */
4336
4350
  function () {
4337
4351
  };
4338
- win_grid_help.decorators = [
4339
- { type: Component, args: [{
4340
- 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-flat-button style=\"background-color: #F5F5F5\" (click)=\"dialogRef.close('')\">CHIUDI</button>\n </mat-dialog-actions>\n ",
4341
- styles: ["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]
4342
- }] }
4343
- ];
4344
- /** @nocollapse */
4345
- win_grid_help.ctorParameters = function () { return [
4346
- { type: MatDialogRef },
4347
- { type: ToastrService },
4348
- { type: AppService }
4349
- ]; };
4350
- return win_grid_help;
4351
- }());
4352
-
4353
- /**
4354
- * @fileoverview added by tsickle
4355
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4356
- */
4357
- var FHComboboxComponent = /** @class */ (function () {
4358
- function FHComboboxComponent(_dataService, _dataService_odbc) {
4359
- this._dataService = _dataService;
4360
- this._dataService_odbc = _dataService_odbc;
4361
- this.init_fill = true;
4362
- this.sql = "";
4363
- this.types = [];
4364
- this.values = [];
4365
- this.hidden = false;
4366
- this.label = "";
4367
- this.enabled = true;
4368
- this.required = false;
4369
- this.sel_label = "";
4370
- this.fillend = new EventEmitter();
4371
- this.selchange = new EventEmitter();
4372
- this.initend = new EventEmitter();
4373
- this.myData = [];
4374
- this.valDef = "-1";
4375
- this.selval = "-1";
4376
- this.errorMsg = "";
4377
- this.db_type = "1";
4378
- this.dis_value = '';
4379
- this.descri_val = "";
4380
- }
4381
4352
  /**
4382
- * @private
4383
4353
  * @return {?}
4384
4354
  */
4385
- FHComboboxComponent.prototype.update_dis = /**
4386
- * @private
4355
+ WinAskTextBigComponent.prototype.show = /**
4387
4356
  * @return {?}
4388
4357
  */
4389
4358
  function () {
4390
- this.dis_value = '';
4391
- try {
4392
- if (this.descri_val != null)
4393
- if (this.descri_val != "") {
4394
- this.dis_value = this.descri_val;
4395
- return;
4396
- }
4397
- if (this.valDef == null)
4398
- this.dis_value = '';
4399
- else
4400
- this.dis_value = this.valDef.split('-1').join('');
4401
- }
4402
- catch (e) {
4403
- console.log('errore split -> this.valDef ', this.valDef);
4404
- }
4405
4359
  };
4406
4360
  /**
4407
4361
  * @return {?}
4408
4362
  */
4409
- FHComboboxComponent.prototype.resetValue = /**
4363
+ WinAskTextBigComponent.prototype.hide = /**
4410
4364
  * @return {?}
4411
4365
  */
4412
4366
  function () {
4413
- this.selval = '-1';
4414
- this.valDef = '-1';
4415
- this.update_dis();
4367
+ this.dialogRef.close(null);
4416
4368
  };
4417
4369
  /**
4418
4370
  * @return {?}
4419
4371
  */
4420
- FHComboboxComponent.prototype.focus = /**
4372
+ WinAskTextBigComponent.prototype.do_check = /**
4421
4373
  * @return {?}
4422
4374
  */
4423
4375
  function () {
4424
- this.smtr.nativeElement.focus();
4376
+ if (this.valore.length < this.min_chars) {
4377
+ this.toastr.error('Il valore deve contenere almeno ' + this.min_chars + ' caratteri');
4378
+ return;
4379
+ }
4380
+ this.dialogRef.close(this.valore);
4381
+ };
4382
+ /**
4383
+ * @return {?}
4384
+ */
4385
+ WinAskTextBigComponent.prototype.chiudi = /**
4386
+ * @return {?}
4387
+ */
4388
+ function () {
4389
+ this.dialogRef.close(null);
4390
+ };
4391
+ WinAskTextBigComponent.decorators = [
4392
+ { type: Component, args: [{
4393
+ selector: 'app-win_ask_text',
4394
+ template: "\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style=\"width:630px;font-size: 12px;\">\n <mat-form-field appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <textarea matInput [readonly]=\"readonly\" [(ngModel)]=\"valore\" style=\"min-width:600px\" rows=\"15\"\n required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" style=\"width: 100%\">\n\n <button *ngIf=\"show_ok\" mat-flat-button color=\"primary\" (click)=\"do_check()\">OK</button>&nbsp;&nbsp;&nbsp;\n <button *ngIf=\"show_annulla\" mat-flat-button color=\"warn\" (click)=\"chiudi()\">ANNULLA</button>\n </div>\n\n\n "
4395
+ }] }
4396
+ ];
4397
+ /** @nocollapse */
4398
+ WinAskTextBigComponent.ctorParameters = function () { return [
4399
+ { type: MatDialogRef },
4400
+ { type: ToastrService }
4401
+ ]; };
4402
+ WinAskTextBigComponent.propDecorators = {
4403
+ title: [{ type: Input }],
4404
+ label: [{ type: Input }],
4405
+ valore: [{ type: Input }],
4406
+ readonly: [{ type: Input }],
4407
+ show_annulla: [{ type: Input }],
4408
+ show_ok: [{ type: Input }]
4425
4409
  };
4410
+ return WinAskTextBigComponent;
4411
+ }());
4412
+
4413
+ /**
4414
+ * @fileoverview added by tsickle
4415
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4416
+ */
4417
+ var FHWinComboSelect = /** @class */ (function () {
4418
+ function FHWinComboSelect(dialogRef, toastr) {
4419
+ this.dialogRef = dialogRef;
4420
+ this.toastr = toastr;
4421
+ this.label = "";
4422
+ this.width = "100%";
4423
+ this.nota = false;
4424
+ this.nota_val = "";
4425
+ }
4426
4426
  /**
4427
+ * @param {?} lab
4428
+ * @param {?} myD
4429
+ * @param {?=} nota
4427
4430
  * @return {?}
4428
4431
  */
4429
- FHComboboxComponent.prototype.reset = /**
4432
+ FHWinComboSelect.prototype.set_selection = /**
4433
+ * @param {?} lab
4434
+ * @param {?} myD
4435
+ * @param {?=} nota
4430
4436
  * @return {?}
4431
4437
  */
4432
- function () {
4433
- this.selval = '-1';
4434
- this.valDef = '-1';
4435
- this.myData = new Array();
4436
- this.update_dis();
4438
+ function (lab, myD, nota) {
4439
+ if (nota === void 0) { nota = false; }
4440
+ this.nota = nota;
4441
+ this.label = lab;
4442
+ for (var i = 0; i < myD.length; i++)
4443
+ this.cmb_sel.add_option(myD[i]);
4437
4444
  };
4438
4445
  /**
4439
4446
  * @return {?}
4440
4447
  */
4441
- FHComboboxComponent.prototype.fillCombo = /**
4448
+ FHWinComboSelect.prototype.ok = /**
4442
4449
  * @return {?}
4443
4450
  */
4444
4451
  function () {
4445
- var _this = this;
4446
- // console.log(this.init_fill);
4447
- // if(!this.init_fill){this.init_fill=true;return;}
4448
- // console.log("fillcombo "+this.sql);
4449
- if (this.sql.indexOf('|') != -1 && this.sql.indexOf('$') != -1) {
4450
- this.set_options(this.sql);
4452
+ if (this.cmb_sel.getValue() == "-1") {
4453
+ this.toastr.error('Selezionare un valore');
4451
4454
  return;
4452
4455
  }
4453
- /** @type {?} */
4454
- var p = new QParam();
4455
- p.sql = this.sql;
4456
- p.types = this.types;
4457
- p.values = this.values;
4458
- // console.log(p);
4459
- if (this.db_type == "1")
4460
- this
4461
- ._dataService
4462
- .doQuery(p)
4463
- .subscribe((/**
4464
- * @param {?} data
4465
- * @return {?}
4466
- */
4467
- function (data) {
4468
- if (data != null)
4469
- if (data.result_msg == "OK") {
4470
- _this.resetD(data.result_data);
4471
- }
4472
- }), (/**
4473
- * @param {?} err
4474
- * @return {?}
4475
- */
4476
- function (err) {
4477
- _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
4478
- }));
4479
- if (this.db_type == "2")
4480
- this
4481
- ._dataService_odbc
4482
- .doQuery(p)
4483
- .subscribe((/**
4484
- * @param {?} data
4485
- * @return {?}
4486
- */
4487
- function (data) {
4488
- if (data != null)
4489
- if (data.result_msg == "OK") {
4490
- for (var i = 0; i < data.result_data.length; i++) {
4491
- if (data.result_data[i].VALORE != null)
4492
- data.result_data[i].valore = data.result_data[i].VALORE;
4493
- if (data.result_data[i].DESCRIZIONE_VALORE != null)
4494
- data.result_data[i].descrizione_valore = data.result_data[i].DESCRIZIONE_VALORE;
4495
- }
4496
- _this.resetD(data.result_data);
4497
- }
4498
- }), (/**
4499
- * @param {?} err
4500
- * @return {?}
4501
- */
4502
- function (err) {
4503
- _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
4504
- }));
4456
+ this.cmb_sel.getObj().nota = this.nota_val;
4457
+ this.dialogRef.close(this.cmb_sel.getObj());
4505
4458
  };
4506
4459
  /**
4507
- * @param {?} o
4508
4460
  * @return {?}
4509
4461
  */
4510
- FHComboboxComponent.prototype.add_option = /**
4511
- * @param {?} o
4462
+ FHWinComboSelect.prototype.ngOnInit = /**
4512
4463
  * @return {?}
4513
4464
  */
4514
- function (o) {
4515
- this.myData.push(o);
4465
+ function () {
4516
4466
  };
4517
- /**
4518
- * @param {?} o
4519
- * @return {?}
4520
- */
4521
- FHComboboxComponent.prototype.resetD = /**
4522
- * @param {?} o
4523
- * @return {?}
4524
- */
4525
- function (o) {
4526
- this.myData = o;
4527
- this.selval = '-1';
4528
- // console.log(this.smtr); console.log(this.smtr.nativeElement);
4529
- this.setByValue(this.valDef);
4530
- if (this.getValue() == "-1" && this.valDef != "-1")
4531
- this.setByDescri(this.valDef);
4532
- this.fillend.emit();
4467
+ FHWinComboSelect.decorators = [
4468
+ { type: Component, args: [{
4469
+ selector: 'fhwincomboselect',
4470
+ template: " \n\n <div fxLayout=\"column\">\n <mat-dialog-content style=\"font-size: 12px;\" >\n \n <div fxLayout=\"column\">\n <h3>\n {{label | uppercase}}\n </h3>\n <FHComboBox #cmb_sel [init_fill]=\"false\"></FHComboBox>\n <mat-form-field *ngIf=\"nota\" appearance=\"outline\" floatLabel=\"always\"><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]=\"nota_val\" rows=\"12\"></textarea>\n </mat-form-field> \n </div>\n </mat-dialog-content>\n\n\n <mat-dialog-actions fxFlex=\"100\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <button mat-flat-button color=\"primary\" (click)=\"ok()\">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color=\"warn\" (click)=\"dialogRef.close(null)\">ANNULLA</button>\n </mat-dialog-actions>\n </div>\n "
4471
+ }] }
4472
+ ];
4473
+ /** @nocollapse */
4474
+ FHWinComboSelect.ctorParameters = function () { return [
4475
+ { type: MatDialogRef },
4476
+ { type: ToastrService }
4477
+ ]; };
4478
+ FHWinComboSelect.propDecorators = {
4479
+ cmb_sel: [{ type: ViewChild, args: ['cmb_sel',] }]
4533
4480
  };
4481
+ return FHWinComboSelect;
4482
+ }());
4483
+
4484
+ /**
4485
+ * @fileoverview added by tsickle
4486
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4487
+ */
4488
+ var FHUploadPanelComponent = /** @class */ (function () {
4489
+ function FHUploadPanelComponent(_appservice, _dataService, toastr, dialog, auth_s, uti) {
4490
+ this._appservice = _appservice;
4491
+ this._dataService = _dataService;
4492
+ this.toastr = toastr;
4493
+ this.dialog = dialog;
4494
+ this.auth_s = auth_s;
4495
+ this.uti = uti;
4496
+ this.enabled = true;
4497
+ this.label = '';
4498
+ this.sovrascrivi_path = '';
4499
+ this.ruolo_supervisore = '[ZZZ_DIS_CC]';
4500
+ this.access_control = false;
4501
+ this.show_images = true;
4502
+ this.change = new EventEmitter();
4503
+ this.App = '';
4504
+ this.K = '';
4505
+ this.image_type = false;
4506
+ this.b_edit_loaded = false;
4507
+ this.b_False = false;
4508
+ this.b_mobile = false;
4509
+ this.b_ini = false;
4510
+ this.m_p_tipo = "";
4511
+ this.multi_list = false;
4512
+ this.m_programma_da_eseguire = "";
4513
+ }
4534
4514
  /**
4535
- * @param {?} desc_val
4515
+ * @param {?} ax
4536
4516
  * @return {?}
4537
4517
  */
4538
- FHComboboxComponent.prototype.setByDescri = /**
4539
- * @param {?} desc_val
4518
+ FHUploadPanelComponent.prototype.download_all = /**
4519
+ * @param {?} ax
4540
4520
  * @return {?}
4541
4521
  */
4542
- function (desc_val) {
4543
- // console.log("setByDescri "+desc_val);
4544
- this.valDef = desc_val;
4545
- this.selval = '-1';
4546
- if (desc_val == "")
4547
- return;
4548
- if (this.myData == null)
4549
- return;
4550
- if (this.myData.length == 0 || this.myData[0] == null)
4551
- return;
4552
- for (var j = 0; j < this.myData.length; j++)
4553
- if (this.myData[j].descrizione_valore == desc_val) {
4554
- this.selval = "" + this.myData[j].valore;
4555
- if (this.myData[j].descrizione_valore != null)
4556
- this.descri_val = this.myData[j].descrizione_valore;
4557
- this.update_dis();
4558
- return;
4559
- }
4560
- this.update_dis();
4522
+ function (ax) {
4523
+ if (ax.APP != null)
4524
+ ax.App = ax.APP;
4525
+ if (this.sovrascrivi_path == '') {
4526
+ window.open(this._appservice.COMPANY_SITE_ROOT + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
4527
+ }
4528
+ else {
4529
+ window.open(this.sovrascrivi_path + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
4530
+ }
4561
4531
  };
4562
4532
  /**
4563
- * @param {?} ind
4533
+ * @param {?} ax
4564
4534
  * @return {?}
4565
4535
  */
4566
- FHComboboxComponent.prototype.setByIndex = /**
4567
- * @param {?} ind
4536
+ FHUploadPanelComponent.prototype.edit_tipo = /**
4537
+ * @param {?} ax
4568
4538
  * @return {?}
4569
4539
  */
4570
- function (ind) {
4571
- this.valDef = "";
4572
- this.selval = '-1';
4573
- if (this.myData == null)
4574
- return;
4575
- if (this.myData.length == 0 || this.myData[0] == null)
4576
- return;
4577
- if (this.myData.length > ind) {
4578
- this.setByDescri(this.myData[ind].descrizione_valore);
4579
- }
4540
+ function (ax) {
4541
+ var _this = this;
4542
+ /** @type {?} */
4543
+ var p = new QParam();
4544
+ p.sql = this.m_p_tipo;
4545
+ p.types = [];
4546
+ p.values = [];
4547
+ this
4548
+ ._dataService
4549
+ .doQuery(p)
4550
+ .subscribe((/**
4551
+ * @param {?} data
4552
+ * @return {?}
4553
+ */
4554
+ function (data) {
4555
+ if (data != null)
4556
+ if (data.result_msg == "OK") {
4557
+ /** @type {?} */
4558
+ var dialogRef = _this
4559
+ .dialog
4560
+ .open(FHWinComboSelect);
4561
+ dialogRef.componentInstance.set_selection("Tipologia Allegato", data.result_data);
4562
+ dialogRef
4563
+ .afterClosed()
4564
+ .subscribe((/**
4565
+ * @param {?} result
4566
+ * @return {?}
4567
+ */
4568
+ function (result) {
4569
+ if (result != null) {
4570
+ /** @type {?} */
4571
+ var p_1 = new QParam();
4572
+ p_1.sql = "UPDATE_ALLEGATI_TIPO";
4573
+ p_1.types = ['int', 'string'];
4574
+ p_1.values = [ax.id, result.descrizione_valore];
4575
+ _this
4576
+ ._dataService
4577
+ .doQuery(p_1)
4578
+ .subscribe((/**
4579
+ * @param {?} data
4580
+ * @return {?}
4581
+ */
4582
+ function (data) {
4583
+ if (data != null)
4584
+ if (data.result_msg == "OK") {
4585
+ _this.ref_allegato();
4586
+ }
4587
+ }));
4588
+ }
4589
+ }));
4590
+ }
4591
+ }));
4580
4592
  };
4581
4593
  /**
4594
+ * @param {?} ax
4582
4595
  * @return {?}
4583
4596
  */
4584
- FHComboboxComponent.prototype.getObj = /**
4597
+ FHUploadPanelComponent.prototype.edit_descri = /**
4598
+ * @param {?} ax
4585
4599
  * @return {?}
4586
4600
  */
4587
- function () {
4588
- if (this.selval == null)
4589
- return null;
4590
- if (this.selval == "-1")
4591
- return null;
4592
- else
4593
- for (var j = 0; j < this.myData.length; j++)
4594
- if (this.myData[j].valore == this.selval) {
4595
- return this.myData[j];
4596
- }
4601
+ function (ax) {
4602
+ var _this = this;
4603
+ /** @type {?} */
4604
+ var dialogRef = this
4605
+ .dialog
4606
+ .open(WinAskTextBigComponent);
4607
+ dialogRef.componentInstance.label = "Descrizione Allegato";
4608
+ dialogRef.componentInstance.valore = ax.descrizione;
4609
+ dialogRef.componentInstance.min_chars = 0;
4610
+ dialogRef
4611
+ .afterClosed()
4612
+ .subscribe((/**
4613
+ * @param {?} result
4614
+ * @return {?}
4615
+ */
4616
+ function (result) {
4617
+ if (result != null) {
4618
+ /** @type {?} */
4619
+ var p = new QParam();
4620
+ p.sql = "UPDATE_ALLEGATI_DESCRIZIONE";
4621
+ p.types = ['int', 'string'];
4622
+ p.values = [ax.id, result];
4623
+ _this
4624
+ ._dataService
4625
+ .doQuery(p)
4626
+ .subscribe((/**
4627
+ * @param {?} data
4628
+ * @return {?}
4629
+ */
4630
+ function (data) {
4631
+ if (data != null)
4632
+ if (data.result_msg == "OK") {
4633
+ _this.ref_allegato();
4634
+ }
4635
+ }));
4636
+ }
4637
+ }));
4597
4638
  };
4598
4639
  /**
4599
- * @param {?} desc_val
4640
+ * @param {?} ax
4600
4641
  * @return {?}
4601
4642
  */
4602
- FHComboboxComponent.prototype.setByValue = /**
4603
- * @param {?} desc_val
4643
+ FHUploadPanelComponent.prototype.delete = /**
4644
+ * @param {?} ax
4604
4645
  * @return {?}
4605
4646
  */
4606
- function (desc_val) {
4607
- this.valDef = desc_val;
4608
- this.selval = '-1';
4609
- // console.log(this.myData);
4610
- if ("" + desc_val == "") {
4611
- // console.log('qqq1111');
4612
- return;
4613
- }
4614
- // console.log("qui");
4615
- if (this.myData == null)
4616
- return;
4617
- // console.log("qui1");
4618
- if (this.myData.length == 0 || this.myData[0] == null)
4619
- return;
4620
- //console.log("qui2");
4621
- for (var j = 0; j < this.myData.length; j++) {
4622
- //console.log(this.myData[j].valore +' '+ desc_val);
4623
- if (this.myData[j].valore == desc_val) {
4624
- this.selval = "" + this.myData[j].valore;
4625
- if (this.myData[j].descrizione_valore != null)
4626
- this.descri_val = this.myData[j].descrizione_valore;
4627
- this.update_dis();
4628
- return;
4647
+ function (ax) {
4648
+ var _this = this;
4649
+ localStorage.setItem(this._appservice.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
4650
+ localStorage.setItem(this._appservice.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
4651
+ /** @type {?} */
4652
+ var dialogRef = this
4653
+ .dialog
4654
+ .open(FHConfirmComponent);
4655
+ dialogRef
4656
+ .afterClosed()
4657
+ .subscribe((/**
4658
+ * @param {?} result
4659
+ * @return {?}
4660
+ */
4661
+ function (result) {
4662
+ if (result) {
4663
+ /** @type {?} */
4664
+ var p = new QParam();
4665
+ p.sql = "DELETE_ALLEGATO";
4666
+ p.types = ['int', 'string'];
4667
+ p.values = [ax.id, _this.auth_s.username];
4668
+ _this
4669
+ ._dataService
4670
+ .doQuery(p)
4671
+ .subscribe((/**
4672
+ * @param {?} data
4673
+ * @return {?}
4674
+ */
4675
+ function (data) {
4676
+ if (data != null)
4677
+ if (data.result_msg == "OK") {
4678
+ // this.arr_g = data.result_data;
4679
+ _this.ref_allegato();
4680
+ _this
4681
+ .toastr
4682
+ .info("INFO", "ALLEGATO ELIMINATO", {
4683
+ timeOut: 1000,
4684
+ progressBar: true
4685
+ });
4686
+ }
4687
+ }), (/**
4688
+ * @param {?} err
4689
+ * @return {?}
4690
+ */
4691
+ function (err) {
4692
+ }));
4629
4693
  }
4630
- }
4631
- this.update_dis();
4694
+ }));
4632
4695
  };
4633
4696
  /**
4634
4697
  * @return {?}
4635
4698
  */
4636
- FHComboboxComponent.prototype.getDescri = /**
4699
+ FHUploadPanelComponent.prototype.ngOnInit = /**
4637
4700
  * @return {?}
4638
4701
  */
4639
4702
  function () {
4640
- if (!this.enabled) {
4641
- if (this.selval == null)
4642
- return this.valDef;
4643
- if (this.selval == "-1")
4644
- return this.valDef;
4703
+ this.upc.single = false;
4704
+ this.b_mobile = this._appservice.getState().pageFullscreen;
4705
+ console.log('this.m_p_tipo ', this.m_p_tipo);
4706
+ this
4707
+ .upc
4708
+ .init(this.App, this.K, 'Descrizione Allegato', this.m_p_tipo, this.m_programma_da_eseguire);
4709
+ if (this.m_p_tipo.indexOf('SELECT_') > -1) {
4710
+ this.multi_list = true;
4645
4711
  }
4646
- if (this.selval == null)
4647
- return "-1";
4648
- if (this.selval == "-1")
4649
- return "-1";
4650
- else
4651
- for (var j = 0; j < this.myData.length; j++)
4652
- if (this.myData[j].valore == this.selval) {
4653
- return this.myData[j].descrizione_valore;
4654
- }
4712
+ this.ref_allegato();
4655
4713
  };
4656
4714
  /**
4715
+ * @param {?} p_app
4716
+ * @param {?} p_k
4717
+ * @param {?=} p_tipo
4718
+ * @param {?=} programma_da_eseguire
4657
4719
  * @return {?}
4658
4720
  */
4659
- FHComboboxComponent.prototype.getValue = /**
4721
+ FHUploadPanelComponent.prototype.init = /**
4722
+ * @param {?} p_app
4723
+ * @param {?} p_k
4724
+ * @param {?=} p_tipo
4725
+ * @param {?=} programma_da_eseguire
4660
4726
  * @return {?}
4661
4727
  */
4662
- function () {
4663
- // console.log(this.selval);
4664
- if (!this.enabled) {
4665
- if (this.selval == null)
4666
- return this.valDef;
4667
- if (this.selval == "-1")
4668
- return this.valDef;
4669
- }
4670
- if (this.selval == null)
4671
- return "-1";
4672
- if (this.selval == "")
4673
- return "-1";
4674
- else
4675
- return this.selval;
4728
+ function (p_app, p_k, p_tipo, programma_da_eseguire) {
4729
+ if (p_tipo === void 0) { p_tipo = ""; }
4730
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
4731
+ this.App = p_app;
4732
+ this.K = p_k;
4733
+ this.b_ini = true;
4734
+ this.b_edit_loaded = false;
4735
+ this.m_p_tipo = p_tipo;
4736
+ this.m_programma_da_eseguire = programma_da_eseguire;
4737
+ this.ngOnInit();
4676
4738
  };
4677
4739
  /**
4678
- * @param {?} campo
4679
4740
  * @return {?}
4680
4741
  */
4681
- FHComboboxComponent.prototype.getData = /**
4682
- * @param {?} campo
4742
+ FHUploadPanelComponent.prototype.ref_allegato = /**
4683
4743
  * @return {?}
4684
4744
  */
4685
- function (campo) {
4686
- for (var x in this.myData) {
4687
- if (this.myData[x]['valore'] == this.selval) {
4688
- return (this.myData[x][campo]);
4689
- }
4690
- else {
4691
- continue;
4692
- }
4693
- }
4745
+ function () {
4746
+ var _this = this;
4747
+ if (this.App == null)
4748
+ return;
4749
+ if (this.App == "")
4750
+ return;
4751
+ /** @type {?} */
4752
+ var p = new QParam();
4753
+ p.sql = "SELECT_ALLEGATO_INFO";
4754
+ p.types = ['string', 'string'];
4755
+ p.values = [this.App, this.K];
4756
+ this
4757
+ ._dataService
4758
+ .doQuery(p)
4759
+ .subscribe((/**
4760
+ * @param {?} data
4761
+ * @return {?}
4762
+ */
4763
+ function (data) {
4764
+ if (data != null)
4765
+ if (data.result_msg == "OK") {
4766
+ _this.arr_g = data.result_data;
4767
+ /** @type {?} */
4768
+ var iconf = "webinfo";
4769
+ for (var i = 0; i < _this.arr_g.length; i++) {
4770
+ if (_this.arr_g[i].APP != null)
4771
+ _this.arr_g[i].App = _this.arr_g[i].APP;
4772
+ if (_this.arr_g[i].descrizione != null)
4773
+ _this.arr_g[i].descrizione_vis = _this.arr_g[i].descrizione.split('\n').join('<br>');
4774
+ else
4775
+ _this.arr_g[i].descrizione_vis = '';
4776
+ /** @type {?} */
4777
+ var arrf = _this.arr_g[i].Filename.split('.');
4778
+ if (_this.sovrascrivi_path == '') {
4779
+ _this.arr_g[i].url = _this._appservice.COMPANY_SITE_ROOT + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4780
+ _this.arr_g[i].url_orig = _this._appservice.COMPANY_SITE_ROOT + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4781
+ }
4782
+ else {
4783
+ _this.arr_g[i].url = _this.sovrascrivi_path + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4784
+ _this.arr_g[i].url_orig = _this.sovrascrivi_path + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4785
+ }
4786
+ if ('3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH'.indexOf(arrf[arrf.length - 1].toLocaleUpperCase()) != -1)
4787
+ iconf = arrf[arrf.length - 1].toLocaleLowerCase();
4788
+ _this.arr_g[i].icon = iconf + '.svg';
4789
+ _this.arr_g[i].can_delete = !_this.access_control || _this.arr_g[i].idp == _this._appservice.user || _this.uti.hasRole(_this.ruolo_supervisore);
4790
+ if ((_this.arr_g[i].Filename.indexOf(".jpg") != -1 || _this.arr_g[i].Filename.indexOf(".gif") != -1 || _this.arr_g[i].Filename.indexOf(".png") != -1) && _this.show_images) {
4791
+ _this.arr_g[i].type = "IMG";
4792
+ _this.arr_g[i].image_original = [_this.arr_g[i].url];
4793
+ if (_this.arr_g[i].preview != null)
4794
+ if (_this.arr_g[i].preview == 1) {
4795
+ /** @type {?} */
4796
+ var pcs = _this.arr_g[i].url.split('.');
4797
+ /** @type {?} */
4798
+ var lastPc = pcs.pop();
4799
+ _this.arr_g[i].url = pcs.join('.') + '_preview.' + lastPc;
4800
+ }
4801
+ _this.image_type = true;
4802
+ _this.arr_g[i].image_thumbnail = [_this.arr_g[i].url];
4803
+ }
4804
+ else
4805
+ _this.arr_g[i].type = "O";
4806
+ }
4807
+ }
4808
+ }));
4809
+ };
4810
+ FHUploadPanelComponent.decorators = [
4811
+ { type: Component, args: [{
4812
+ selector: 'FHUploadPanel', template: "\n <div fxLayout=\"column\">\n <h3>{{label}}</h3>\n <div fxLayout=\"column\">\n <div [hidden]=\"!enabled\">\n <FHUpload [single]=\"b_False\" [lista_allegati]=\"arr_g\" (change)=\"ref_allegato()\" #upc></FHUpload>\n </div>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"!image_type && !b_mobile\">\n <thead>\n <tr class=\"header\">\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">Nome</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n <th style=\"width:40%\">Descrizione</th>\n <th *ngIf=\"multi_list\" style=\"width:20%\">Tipo</th>\n\n <th style=\"width:40px\" class=\"actions\"></th>\n <th style=\"width:30%\" >Utente</th>\n <th style=\"width:240px;text-align:center\">Data</th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;\" style=\"font-size: 12px;\" [ngClass]=\"{ odd: odd, even: even }\">\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n <td>{{app.Filename}}</td>\n <td style=\"text-align:center\">{{app.Filesize}}</td>\n <td>\n <div fxLayout=\"row\">\n <a mat-icon-button matTooltip=\"Modifica Descrizione\" *ngIf=\"app.can_delete\" (click)=\"edit_descri(app)\">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Modifica Descrizione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]=\"app.descrizione_vis\" style=\"width:100%\">\n </div>\n </div></td>\n\n\n <td>\n <div fxLayout=\"row\">\n <a mat-icon-button matTooltip=\"Modifica Tipo\" *ngIf=\"app.can_delete\" (click)=\"edit_tipo(app)\">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Modifica Tipologia consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]=\"app.tipo\" style=\"width:100%\">\n </div>\n </div></td>\n\n <td style=\"min-width:400px;min-height: 400px\" *ngIf=\"app.type=='IMG'\">\n <fh-image-viewer [u]=\"app\"></fh-image-viewer>\n\n </td>\n <td *ngIf=\"app.type!='IMG'\">\n\n </td>\n <td>{{app.nc}}</td>\n <td style=\"text-align:center\">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>\n <td style=\"text-align:center\">\n <button mat-icon-button matTooltip=\"Download File\" (click)=\"download_all(app)\">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a mat-icon-button matTooltip=\"Elimina File\" *ngIf=\"app.can_delete\" (click)=\"delete(app)\">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Cancellazione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"image_type && !b_mobile\">\n <thead>\n <tr class=\"header\">\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">Nome</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n\n <th style=\"width:20%\">Descrizione</th>\n <th *ngIf=\"multi_list\" style=\"width:10%\">Tipo</th>\n <th style=\"width:40%\" ></th>\n\n\n <th style=\"width:10%\" >Utente</th>\n <th style=\"width:240px;text-align:center\">Data</th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;\" style=\"font-size: 12px;\" [ngClass]=\"{ odd: odd, even: even }\">\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n\n <td>{{app.Filename}}</td>\n <td style=\"text-align:center\">{{app.Filesize}}</td>\n <td>\n <div fxLayout=\"row\">\n <a mat-icon-button matTooltip=\"Modifica Descrizione\" *ngIf=\"app.can_delete\" (click)=\"edit_descri(app)\">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Modifica Descrizione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]=\"app.descrizione_vis\" style=\"width:100%\">\n </div>\n </div></td>\n <td *ngIf=\"multi_list\">\n <div fxLayout=\"row\">\n <a mat-icon-button matTooltip=\"Modifica Tipo\" *ngIf=\"app.can_delete\" (click)=\"edit_tipo(app)\">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Modifica Tipologia consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]=\"app.tipo\" style=\"width:100%\">\n </div>\n </div></td>\n\n <td style=\"min-width:400px;min-height: 400px\" *ngIf=\"app.type=='IMG'\">\n <fh-image-viewer [u]=\"app\"></fh-image-viewer>\n\n </td>\n <td *ngIf=\"app.type!='IMG'\">\n\n </td>\n <td>{{app.nc}}</td>\n <td style=\"text-align:center\">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>\n <td style=\"text-align:center\">\n <button mat-icon-button matTooltip=\"Download File\" (click)=\"download_all(app)\">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a mat-icon-button matTooltip=\"Elimina File\" *ngIf=\"app.can_delete\" (click)=\"delete(app)\">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Cancellazione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"b_mobile\">\n <tbody>\n\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;\" style=\"font-size: 12px;\" [ngClass]=\"{ odd: odd, even: even }\">\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n <td *ngIf=\"b_mobile\" style=\"text-align:center\">{{app.Filename}}<br><br>\n <button style=\"background-color: #F5F5F5\" (click)=\"download_all(app)\" mat-flat-button>DOWNLOAD</button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf=\"!b_ini\" style=\"color:#ff0000\"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ",
4813
+ styles: ["\n\n\n\n "]
4814
+ }] }
4815
+ ];
4816
+ /** @nocollapse */
4817
+ FHUploadPanelComponent.ctorParameters = function () { return [
4818
+ { type: AppService },
4819
+ { type: QueryService },
4820
+ { type: ToastrService },
4821
+ { type: MatDialog },
4822
+ { type: AuthenticationService },
4823
+ { type: UtilityService }
4824
+ ]; };
4825
+ FHUploadPanelComponent.propDecorators = {
4826
+ enabled: [{ type: Input }],
4827
+ label: [{ type: Input }],
4828
+ sovrascrivi_path: [{ type: Input }],
4829
+ ruolo_supervisore: [{ type: Input }],
4830
+ access_control: [{ type: Input }],
4831
+ show_images: [{ type: Input }],
4832
+ change: [{ type: Output }],
4833
+ upc: [{ type: ViewChild, args: ['upc',] }]
4694
4834
  };
4835
+ return FHUploadPanelComponent;
4836
+ }());
4837
+
4838
+ /**
4839
+ * @fileoverview added by tsickle
4840
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4841
+ */
4842
+ var GridService = /** @class */ (function () {
4843
+ function GridService(http, app_s, toastr) {
4844
+ this.http = http;
4845
+ this.app_s = app_s;
4846
+ this.toastr = toastr;
4847
+ this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT; // URL to web API
4848
+ }
4849
+ // URL to web API
4695
4850
  /**
4696
- * @param {?} s
4851
+ * @param {?} queryp
4852
+ * @param {?=} displayError
4853
+ * @param {?=} url_sec
4697
4854
  * @return {?}
4698
4855
  */
4699
- FHComboboxComponent.prototype.set_options = /**
4700
- * @param {?} s
4856
+ GridService.prototype.doQuery =
4857
+ // URL to web API
4858
+ /**
4859
+ * @param {?} queryp
4860
+ * @param {?=} displayError
4861
+ * @param {?=} url_sec
4701
4862
  * @return {?}
4702
4863
  */
4703
- function (s) {
4704
- this.myData = new Array();
4864
+ function (queryp, displayError, url_sec) {
4865
+ var _this = this;
4866
+ if (displayError === void 0) { displayError = true; }
4867
+ if (url_sec === void 0) { url_sec = null; }
4868
+ this.headers = new HttpHeaders({
4869
+ 'Content-Type': 'application/json',
4870
+ 'Authorization': 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
4871
+ });
4872
+ if (url_sec == null)
4873
+ this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT;
4874
+ else
4875
+ this.url = url_sec;
4705
4876
  /** @type {?} */
4706
- var a = s.split('$');
4707
- for (var i = 0; i < a.length; i++) {
4708
- /** @type {?} */
4709
- var o = new Object();
4877
+ var post_v = JSON.stringify(queryp);
4878
+ return this.http.post(this.url, post_v, { headers: this.headers })
4879
+ .pipe(map((/**
4880
+ * @param {?} res
4881
+ * @return {?}
4882
+ */
4883
+ function (res) {
4884
+ // Handle errors, display if enabled
4710
4885
  /** @type {?} */
4711
- var av = a[i].split('|');
4712
- o.valore = av[1];
4713
- o.descrizione_valore = av[0];
4714
- this
4715
- .myData
4716
- .push(o);
4717
- }
4718
- this.setByValue(this.valDef);
4719
- if (this.getValue() == "-1")
4720
- this.setByDescri(this.valDef);
4721
- };
4722
- /**
4723
- * @return {?}
4724
- */
4725
- FHComboboxComponent.prototype.ngAfterViewInit = /**
4726
- * @return {?}
4727
- */
4728
- function () {
4729
- // console.log("ngAfterViewInit"); console.log(this.init_fill);
4730
- };
4731
- /**
4732
- * @return {?}
4733
- */
4734
- FHComboboxComponent.prototype.ngOnInit = /**
4735
- * @return {?}
4736
- */
4737
- function () {
4738
- if (this.init_fill == true) {
4739
- if (this.sql == '') {
4740
- //this.errorMsg="QUERY NON CONFIGURATA";
4741
- return;
4886
+ var err;
4887
+ if (!res) {
4888
+ err = new Error('Empty server response');
4742
4889
  }
4743
- this.fillCombo();
4744
- }
4745
- else {
4746
- this.errorMsg = "";
4747
- }
4748
- this
4749
- .initend
4750
- .emit();
4890
+ else if (res.result_msg === 'KO') {
4891
+ err = new Error(res.msg);
4892
+ }
4893
+ if (err) {
4894
+ console.error(err);
4895
+ if (displayError) {
4896
+ _this.toastr.error(err.message);
4897
+ }
4898
+ throw new Error(err);
4899
+ }
4900
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4901
+ })), catchError((/**
4902
+ * @param {?} err
4903
+ * @return {?}
4904
+ */
4905
+ function (err) {
4906
+ // In a real world app, we might use a remote logging infrastructure
4907
+ // We'd also dig deeper into the error to get a better message
4908
+ /** @type {?} */
4909
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4910
+ console.error(errMsg); // log to console instead
4911
+ throw err;
4912
+ })));
4751
4913
  };
4914
+ GridService.decorators = [
4915
+ { type: Injectable, args: [{
4916
+ providedIn: 'root',
4917
+ },] }
4918
+ ];
4919
+ /** @nocollapse */
4920
+ GridService.ctorParameters = function () { return [
4921
+ { type: HttpClient },
4922
+ { type: AppService },
4923
+ { type: ToastrService }
4924
+ ]; };
4925
+ /** @nocollapse */ GridService.ngInjectableDef = defineInjectable({ factory: function GridService_Factory() { return new GridService(inject(HttpClient), inject(AppService), inject(ToastrService)); }, token: GridService, providedIn: "root" });
4926
+ return GridService;
4927
+ }());
4928
+
4929
+ /**
4930
+ * @fileoverview added by tsickle
4931
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4932
+ */
4933
+ var win_grid_help = /** @class */ (function () {
4934
+ function win_grid_help(dialogRef, toastr, m_appService) {
4935
+ this.dialogRef = dialogRef;
4936
+ this.toastr = toastr;
4937
+ this.m_appService = m_appService;
4938
+ this.title = "";
4939
+ }
4752
4940
  /**
4753
4941
  * @return {?}
4754
4942
  */
4755
- FHComboboxComponent.prototype.sc = /**
4943
+ win_grid_help.prototype.ngOnInit = /**
4756
4944
  * @return {?}
4757
4945
  */
4758
4946
  function () {
4759
- this
4760
- .selchange
4761
- .emit({ event: this.getObj(), valore: this.getValue(), descrizione_valore: this.getDescri() });
4762
4947
  };
4763
- FHComboboxComponent.decorators = [
4948
+ win_grid_help.decorators = [
4764
4949
  { type: Component, args: [{
4765
- selector: 'FHComboBox', template: "\n <mat-form-field [hidden]=\"!enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <mat-select #cmb [(ngModel)]=\"selval\" (selectionChange)=\"sc()\" [required]=\"required\">\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\n <mat-form-field [hidden]=\"enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input type=\"text\" #el1 matInput [disabled]=\"true\" [(ngModel)]=\"dis_value\">\n </mat-form-field>\n ",
4766
- styles: ["\n\n "]
4950
+ 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-flat-button style=\"background-color: #F5F5F5\" (click)=\"dialogRef.close('')\">CHIUDI</button>\n </mat-dialog-actions>\n ",
4951
+ styles: ["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]
4767
4952
  }] }
4768
4953
  ];
4769
4954
  /** @nocollapse */
4770
- FHComboboxComponent.ctorParameters = function () { return [
4771
- { type: QueryService },
4772
- { type: OdbcService }
4955
+ win_grid_help.ctorParameters = function () { return [
4956
+ { type: MatDialogRef },
4957
+ { type: ToastrService },
4958
+ { type: AppService }
4773
4959
  ]; };
4774
- FHComboboxComponent.propDecorators = {
4775
- init_fill: [{ type: Input }],
4776
- sql: [{ type: Input }],
4777
- types: [{ type: Input }],
4778
- values: [{ type: Input }],
4779
- hidden: [{ type: Input }],
4780
- label: [{ type: Input }],
4781
- enabled: [{ type: Input }],
4782
- required: [{ type: Input }],
4783
- sel_label: [{ type: Input }],
4784
- smtr: [{ type: ViewChild, args: ['cmb',] }],
4785
- fillend: [{ type: Output }],
4786
- selchange: [{ type: Output }],
4787
- initend: [{ type: Output }],
4788
- valDef: [{ type: Input }],
4789
- db_type: [{ type: Input }]
4790
- };
4791
- return FHComboboxComponent;
4960
+ return win_grid_help;
4792
4961
  }());
4793
4962
 
4794
4963
  /**
@@ -10459,77 +10628,6 @@ var ComboBoxEditor = /** @class */ (function () {
10459
10628
  return ComboBoxEditor;
10460
10629
  }());
10461
10630
 
10462
- /**
10463
- * @fileoverview added by tsickle
10464
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
10465
- */
10466
- var FHWinComboSelect = /** @class */ (function () {
10467
- function FHWinComboSelect(dialogRef, toastr) {
10468
- this.dialogRef = dialogRef;
10469
- this.toastr = toastr;
10470
- this.label = "";
10471
- this.width = "100%";
10472
- this.nota = false;
10473
- this.nota_val = "";
10474
- }
10475
- /**
10476
- * @param {?} lab
10477
- * @param {?} myD
10478
- * @param {?=} nota
10479
- * @return {?}
10480
- */
10481
- FHWinComboSelect.prototype.set_selection = /**
10482
- * @param {?} lab
10483
- * @param {?} myD
10484
- * @param {?=} nota
10485
- * @return {?}
10486
- */
10487
- function (lab, myD, nota) {
10488
- if (nota === void 0) { nota = false; }
10489
- this.nota = nota;
10490
- this.label = lab;
10491
- for (var i = 0; i < myD.length; i++)
10492
- this.cmb_sel.add_option(myD[i]);
10493
- };
10494
- /**
10495
- * @return {?}
10496
- */
10497
- FHWinComboSelect.prototype.ok = /**
10498
- * @return {?}
10499
- */
10500
- function () {
10501
- if (this.cmb_sel.getValue() == "-1") {
10502
- this.toastr.error('Selezionare un valore');
10503
- return;
10504
- }
10505
- this.cmb_sel.getObj().nota = this.nota_val;
10506
- this.dialogRef.close(this.cmb_sel.getObj());
10507
- };
10508
- /**
10509
- * @return {?}
10510
- */
10511
- FHWinComboSelect.prototype.ngOnInit = /**
10512
- * @return {?}
10513
- */
10514
- function () {
10515
- };
10516
- FHWinComboSelect.decorators = [
10517
- { type: Component, args: [{
10518
- selector: 'fhwincomboselect',
10519
- template: " \n\n <div fxLayout=\"column\">\n <mat-dialog-content style=\"font-size: 12px;\" >\n \n <div fxLayout=\"column\">\n <h3>\n {{label | uppercase}}\n </h3>\n <FHComboBox #cmb_sel [init_fill]=\"false\"></FHComboBox>\n <mat-form-field *ngIf=\"nota\" appearance=\"outline\" floatLabel=\"always\"><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]=\"nota_val\" rows=\"12\"></textarea>\n </mat-form-field> \n </div>\n </mat-dialog-content>\n\n\n <mat-dialog-actions fxFlex=\"100\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <button mat-flat-button color=\"primary\" (click)=\"ok()\">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color=\"warn\" (click)=\"dialogRef.close(null)\">ANNULLA</button>\n </mat-dialog-actions>\n </div>\n "
10520
- }] }
10521
- ];
10522
- /** @nocollapse */
10523
- FHWinComboSelect.ctorParameters = function () { return [
10524
- { type: MatDialogRef },
10525
- { type: ToastrService }
10526
- ]; };
10527
- FHWinComboSelect.propDecorators = {
10528
- cmb_sel: [{ type: ViewChild, args: ['cmb_sel',] }]
10529
- };
10530
- return FHWinComboSelect;
10531
- }());
10532
-
10533
10631
  /**
10534
10632
  * @fileoverview added by tsickle
10535
10633
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc