@fluxhub/fluxhub-lib 1.0.596 → 1.0.598

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.
@@ -3152,918 +3152,523 @@
3152
3152
  * @fileoverview added by tsickle
3153
3153
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3154
3154
  */
3155
- var FHUploadComponent = /** @class */ (function () {
3156
- function FHUploadComponent(_dataService, toastr, dialog, app_s) {
3157
- var _this = this;
3155
+ var FHComboboxComponent = /** @class */ (function () {
3156
+ function FHComboboxComponent(_dataService, _dataService_odbc) {
3158
3157
  this._dataService = _dataService;
3159
- this.toastr = toastr;
3160
- this.dialog = dialog;
3161
- this.app_s = app_s;
3162
- this.show_descri = true;
3158
+ this._dataService_odbc = _dataService_odbc;
3159
+ this.init_fill = true;
3160
+ this.sql = "";
3161
+ this.types = [];
3162
+ this.values = [];
3163
+ this.hidden = false;
3164
+ this.label = "";
3163
3165
  this.enabled = true;
3164
- this.single = true;
3165
- this.descri_obb = false;
3166
- this.programma_da_eseguire = '';
3167
- this.label_attendere = 'ATTENDERE UPLOAD IN CORSO';
3168
- this.fixed_label = ' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)';
3169
- this.limit_string = 'Il file di <size>MB supera il limite di 500MB';
3170
- this.allegato_inserito = 'ALLEGATO INSERITO';
3171
- this.inserire_descrizione = 'Descrizione Obbligatoria';
3172
- this.lista_allegati = [];
3173
- this.change = new core.EventEmitter();
3174
- this.upload_ended = new core.EventEmitter();
3175
- this.allow_delete = false;
3176
- this.loading = false;
3177
- this.App = '';
3178
- this.K = '';
3179
- this.label_b = "";
3180
- this.descrizione = '';
3181
- this.file_name = '';
3182
- this.label = '';
3183
- this.username = '';
3184
- this.b_edit_loaded = false;
3185
- this.tipo = '';
3186
- this.b_ini = false;
3187
- this.uploader = new ng2FileUpload.FileUploader({
3188
- url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT,
3189
- 'maxFileSize': 500 * 1024 * 1024
3190
- });
3191
- this.id = null;
3192
- this.username = this.app_s.user;
3193
- this.uploader.onBeforeUploadItem = (/**
3194
- * @param {?} item
3195
- * @return {?}
3196
- */
3197
- function (item) {
3198
- item.withCredentials = false;
3199
- });
3200
- this.uploader.onCompleteItem = (/**
3201
- * @param {?} item
3202
- * @param {?} response
3203
- * @param {?} status
3204
- * @param {?} header
3205
- * @return {?}
3206
- */
3207
- function (item, response, status, header) {
3208
- if (status === 200) {
3209
- _this.descrizione = "";
3210
- _this.toastr.info("INFO", _this.allegato_inserito, {
3211
- timeOut: 1000,
3212
- progressBar: true
3213
- });
3214
- _this.ref_allegato();
3215
- _this.change.emit({ item: item, response: response, status: status, header: header });
3216
- }
3217
- });
3166
+ this.required = false;
3167
+ this.sel_label = "";
3168
+ this.fillend = new core.EventEmitter();
3169
+ this.selchange = new core.EventEmitter();
3170
+ this.initend = new core.EventEmitter();
3171
+ this.myData = [];
3172
+ this.valDef = "-1";
3173
+ this.selval = "-1";
3174
+ this.errorMsg = "";
3175
+ this.db_type = "1";
3176
+ this.dis_value = '';
3177
+ this.descri_val = "";
3218
3178
  }
3219
3179
  /**
3180
+ * @private
3220
3181
  * @return {?}
3221
3182
  */
3222
- FHUploadComponent.prototype.del_doc = /**
3183
+ FHComboboxComponent.prototype.update_dis = /**
3184
+ * @private
3223
3185
  * @return {?}
3224
3186
  */
3225
3187
  function () {
3226
- var _this = this;
3227
- localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
3228
- localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
3229
- /** @type {?} */
3230
- var dialogRef = this
3231
- .dialog
3232
- .open(FHConfirmComponent);
3233
- dialogRef
3234
- .afterClosed()
3235
- .subscribe((/**
3236
- * @param {?} result
3237
- * @return {?}
3238
- */
3239
- function (result) {
3240
- if (result) {
3241
- /** @type {?} */
3242
- var p = new QParam();
3243
- p.sql = "DELETE_ALLEGATO";
3244
- p.types = ['int', 'string'];
3245
- p.values = [_this.id, _this.app_s.user];
3246
- _this
3247
- ._dataService
3248
- .doQuery(p)
3249
- .subscribe((/**
3250
- * @param {?} data
3251
- * @return {?}
3252
- */
3253
- function (data) {
3254
- if (data != null)
3255
- if (data.result_msg == "OK") {
3256
- // this.arr_g = data.result_data;
3257
- _this.ref_allegato();
3258
- _this
3259
- .toastr
3260
- .info("INFO", "ALLEGATO ELIMINATO", {
3261
- timeOut: 1000,
3262
- progressBar: true
3263
- });
3264
- }
3265
- }), (/**
3266
- * @param {?} err
3267
- * @return {?}
3268
- */
3269
- function (err) {
3270
- }));
3271
- }
3272
- }));
3188
+ this.dis_value = '';
3189
+ try {
3190
+ if (this.descri_val != null)
3191
+ if (this.descri_val != "") {
3192
+ this.dis_value = this.descri_val;
3193
+ return;
3194
+ }
3195
+ if (this.valDef == null)
3196
+ this.dis_value = '';
3197
+ else
3198
+ this.dis_value = this.valDef.split('-1').join('');
3199
+ }
3200
+ catch (e) {
3201
+ console.log('errore split -> this.valDef ', this.valDef);
3202
+ }
3273
3203
  };
3274
3204
  /**
3275
3205
  * @return {?}
3276
3206
  */
3277
- FHUploadComponent.prototype.ngOnInit = /**
3207
+ FHComboboxComponent.prototype.resetValue = /**
3278
3208
  * @return {?}
3279
3209
  */
3280
3210
  function () {
3281
- var _this = this;
3282
- /** @type {?} */
3283
- var uo = {};
3284
- uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
3285
- this.uploader.setOptions(uo);
3286
- this.uploader.onCompleteAll = (/**
3287
- * @return {?}
3288
- */
3289
- function () {
3290
- _this.loading = false;
3291
- _this.upload_ended.emit();
3292
- if (_this.dialogRef != null)
3293
- if (_this.dialogRef.componentInstance != null) {
3294
- _this.dialogRef.componentInstance.update_progess(100);
3295
- _this.dialogRef = null;
3296
- }
3297
- });
3298
- this.uploader.onErrorItem = (/**
3299
- * @param {?} a
3300
- * @param {?} b
3301
- * @param {?} c
3302
- * @param {?} d
3303
- * @return {?}
3304
- */
3305
- function (a, b, c, d) {
3306
- _this.toastr.error(b);
3307
- });
3308
- this.uploader.onAfterAddingFile = (/**
3309
- * @param {?} fileItem
3310
- * @return {?}
3311
- */
3312
- function (fileItem) {
3313
- _this.ch(fileItem);
3314
- });
3315
- this.uploader.onProgressItem = (/**
3316
- * @param {?} fileItem
3317
- * @param {?} progress
3318
- * @return {?}
3319
- */
3320
- function (fileItem, progress) {
3321
- // console.log(fileItem);
3322
- // console.log(progress);
3323
- _this.loading = true;
3324
- if (_this.dialogRef != null)
3325
- if (_this.dialogRef.componentInstance != null)
3326
- _this.dialogRef.componentInstance.update_progess(progress);
3327
- });
3328
- this.uploader.onWhenAddingFileFailed = (/**
3329
- * @param {?} item
3330
- * @param {?} filter
3331
- * @param {?} options
3332
- * @return {?}
3333
- */
3334
- function (item, filter, options) {
3335
- switch (filter.name) {
3336
- case 'fileSize':
3337
- /** @type {?} */
3338
- var ar = Math.round(item.size / 1024 / 1024);
3339
- _this.toastr.error(_this.limit_string.split('<size>').join('' + ar));
3340
- break;
3341
- default:
3342
- _this.toastr.error("Errore: " + filter.name);
3343
- }
3344
- });
3211
+ this.selval = '-1';
3212
+ this.valDef = '-1';
3213
+ this.update_dis();
3345
3214
  };
3346
3215
  /**
3347
3216
  * @return {?}
3348
3217
  */
3349
- FHUploadComponent.prototype.download_all = /**
3218
+ FHComboboxComponent.prototype.focus = /**
3350
3219
  * @return {?}
3351
3220
  */
3352
3221
  function () {
3353
- window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + this.App + '/' + this.K + '/' + this.file_name);
3222
+ this.smtr.nativeElement.focus();
3354
3223
  };
3355
3224
  /**
3356
- * @param {?} fileItem
3357
3225
  * @return {?}
3358
3226
  */
3359
- FHUploadComponent.prototype.ch = /**
3360
- * @param {?} fileItem
3227
+ FHComboboxComponent.prototype.reset = /**
3361
3228
  * @return {?}
3362
3229
  */
3363
- function (fileItem) {
3230
+ function () {
3231
+ console.log('reset');
3232
+ this.selval = '-1';
3233
+ this.valDef = '-1';
3234
+ this.myData = new Array();
3235
+ this.update_dis();
3236
+ };
3237
+ /**
3238
+ * @return {?}
3239
+ */
3240
+ FHComboboxComponent.prototype.fillCombo = /**
3241
+ * @return {?}
3242
+ */
3243
+ function () {
3364
3244
  var _this = this;
3365
- if (this.descri_obb && this.descrizione == '') {
3366
- this.toastr.error(this.inserire_descrizione);
3245
+ // console.log(this.init_fill);
3246
+ // if(!this.init_fill){this.init_fill=true;return;}
3247
+ console.log("fillcombo " + this.sql);
3248
+ if (this.sql.indexOf('|') != -1 && this.sql.indexOf('$') != -1) {
3249
+ this.set_options(this.sql);
3367
3250
  return;
3368
3251
  }
3369
- for (var i = 0; i < this.lista_allegati.length; i++) {
3370
- if (this.lista_allegati[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
3371
- this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
3372
- return;
3373
- }
3374
- }
3375
- this.uploader.onBuildItemForm = (/**
3376
- * @param {?} item
3377
- * @param {?} form
3378
- * @return {?}
3379
- */
3380
- function (item, form) {
3381
- form.append('App', _this.App);
3382
- form.append('K', _this.K);
3383
- form.append('descrizione', _this.descrizione);
3384
- form.append('single', _this.single);
3385
- form.append('username', _this.username);
3386
- form.append('tipo', _this.tipo);
3387
- form.append('local_path', _this.app_s.LOCAL_PATH);
3388
- if (_this.programma_da_eseguire != '')
3389
- form.append('p1', _this.programma_da_eseguire);
3390
- });
3391
- if (this.dialogRef == null) {
3392
- this.dialogRef = this.dialog.open(WinWait, { 'disableClose': true });
3393
- this.dialogRef.componentInstance.label = this.label_attendere;
3394
- this.dialogRef.afterClosed().subscribe((/**
3395
- * @param {?} result
3252
+ /** @type {?} */
3253
+ var p = new QParam();
3254
+ p.sql = this.sql;
3255
+ p.types = this.types;
3256
+ p.values = this.values;
3257
+ // console.log(p);
3258
+ if (this.db_type == "1")
3259
+ this
3260
+ ._dataService
3261
+ .doQuery(p)
3262
+ .subscribe((/**
3263
+ * @param {?} data
3396
3264
  * @return {?}
3397
3265
  */
3398
- function (result) {
3266
+ function (data) {
3267
+ if (data != null)
3268
+ if (data.result_msg == "OK") {
3269
+ _this.resetD(data.result_data);
3270
+ }
3271
+ }), (/**
3272
+ * @param {?} err
3273
+ * @return {?}
3274
+ */
3275
+ function (err) {
3276
+ _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
3277
+ }));
3278
+ if (this.db_type == "2")
3279
+ this
3280
+ ._dataService_odbc
3281
+ .doQuery(p)
3282
+ .subscribe((/**
3283
+ * @param {?} data
3284
+ * @return {?}
3285
+ */
3286
+ function (data) {
3287
+ if (data != null)
3288
+ if (data.result_msg == "OK") {
3289
+ for (var i = 0; i < data.result_data.length; i++) {
3290
+ if (data.result_data[i].VALORE != null)
3291
+ data.result_data[i].valore = data.result_data[i].VALORE;
3292
+ if (data.result_data[i].DESCRIZIONE_VALORE != null)
3293
+ data.result_data[i].descrizione_valore = data.result_data[i].DESCRIZIONE_VALORE;
3294
+ }
3295
+ _this.resetD(data.result_data);
3296
+ }
3297
+ }), (/**
3298
+ * @param {?} err
3299
+ * @return {?}
3300
+ */
3301
+ function (err) {
3302
+ _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
3399
3303
  }));
3400
- }
3401
- this.uploader.uploadAll();
3402
3304
  };
3403
3305
  /**
3404
- * @param {?} p_app
3405
- * @param {?} p_k
3406
- * @param {?} p_label
3407
- * @param {?=} p_tipo
3408
- * @param {?=} programma_da_eseguire
3409
- * @param {?=} allow_delete
3306
+ * @param {?} o
3410
3307
  * @return {?}
3411
3308
  */
3412
- FHUploadComponent.prototype.init = /**
3413
- * @param {?} p_app
3414
- * @param {?} p_k
3415
- * @param {?} p_label
3416
- * @param {?=} p_tipo
3417
- * @param {?=} programma_da_eseguire
3418
- * @param {?=} allow_delete
3309
+ FHComboboxComponent.prototype.add_option = /**
3310
+ * @param {?} o
3419
3311
  * @return {?}
3420
3312
  */
3421
- function (p_app, p_k, p_label, p_tipo, programma_da_eseguire, allow_delete) {
3422
- if (p_tipo === void 0) { p_tipo = ""; }
3423
- if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
3424
- if (allow_delete === void 0) { allow_delete = false; }
3425
- this.App = p_app;
3426
- this.K = p_k;
3427
- this.label = p_label;
3428
- this.tipo = p_tipo;
3429
- this.b_ini = true;
3430
- this.b_edit_loaded = false;
3431
- this.descrizione = "";
3432
- this.programma_da_eseguire = programma_da_eseguire;
3433
- this.allow_delete = allow_delete;
3434
- this.ref_allegato();
3313
+ function (o) {
3314
+ this.myData.push(o);
3435
3315
  };
3436
3316
  /**
3317
+ * @param {?} o
3437
3318
  * @return {?}
3438
3319
  */
3439
- FHUploadComponent.prototype.ref_allegato = /**
3320
+ FHComboboxComponent.prototype.resetD = /**
3321
+ * @param {?} o
3440
3322
  * @return {?}
3441
3323
  */
3442
- function () {
3443
- var _this = this;
3444
- this.id = null;
3445
- this.descrizione = '';
3446
- this.file_name = '';
3447
- this.label_b = '';
3448
- if (!this.single)
3324
+ function (o) {
3325
+ this.myData = o;
3326
+ this.selval = '-1';
3327
+ // console.log(this.smtr); console.log(this.smtr.nativeElement);
3328
+ this.setByValue(this.valDef);
3329
+ if (this.getValue() == "-1" && this.valDef != "-1")
3330
+ this.setByDescri(this.valDef);
3331
+ this.fillend.emit();
3332
+ };
3333
+ /**
3334
+ * @param {?} desc_val
3335
+ * @return {?}
3336
+ */
3337
+ FHComboboxComponent.prototype.setByDescri = /**
3338
+ * @param {?} desc_val
3339
+ * @return {?}
3340
+ */
3341
+ function (desc_val) {
3342
+ // console.log("setByDescri "+desc_val);
3343
+ this.valDef = desc_val;
3344
+ this.selval = '-1';
3345
+ if (desc_val == "")
3449
3346
  return;
3450
- if (this.App == null)
3347
+ if (this.myData == null)
3451
3348
  return;
3452
- if (this.App == "")
3349
+ if (this.myData.length == 0 || this.myData[0] == null)
3453
3350
  return;
3454
- /** @type {?} */
3455
- var p = new QParam();
3456
- p.sql = "SELECT_ALLEGATO_INFO";
3457
- p.types = ['string', 'string'];
3458
- p.values = [this.App, this.K];
3459
- this._dataService.doQuery(p).subscribe((/**
3460
- * @param {?} data
3461
- * @return {?}
3462
- */
3463
- function (data) {
3464
- if (data != null)
3465
- if (data.result_msg == "OK") {
3466
- /** @type {?} */
3467
- var a = data.result_data;
3468
- if (a.length > 0) {
3469
- _this.id = a[0].id;
3470
- _this.descrizione = a[0].descrizione;
3471
- _this.file_name = a[0].Filename;
3472
- _this.label_b = "" + a[0].Filename + " - " + a[0].Filesize + "";
3473
- _this.b_edit_loaded = true;
3474
- }
3475
- }
3476
- }));
3477
- };
3478
- FHUploadComponent.decorators = [
3479
- { type: core.Component, args: [{
3480
- selector: 'FHUpload',
3481
- 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 ",
3482
- styles: ["\n\n "]
3483
- }] }
3484
- ];
3485
- /** @nocollapse */
3486
- FHUploadComponent.ctorParameters = function () { return [
3487
- { type: QueryService },
3488
- { type: ngxToastr.ToastrService },
3489
- { type: material.MatDialog },
3490
- { type: AppService }
3491
- ]; };
3492
- FHUploadComponent.propDecorators = {
3493
- show_descri: [{ type: core.Input }],
3494
- enabled: [{ type: core.Input }],
3495
- single: [{ type: core.Input }],
3496
- descri_obb: [{ type: core.Input }],
3497
- programma_da_eseguire: [{ type: core.Input }],
3498
- label_attendere: [{ type: core.Input }],
3499
- fixed_label: [{ type: core.Input }],
3500
- limit_string: [{ type: core.Input }],
3501
- allegato_inserito: [{ type: core.Input }],
3502
- inserire_descrizione: [{ type: core.Input }],
3503
- lista_allegati: [{ type: core.Input }],
3504
- change: [{ type: core.Output }],
3505
- upload_ended: [{ type: core.Output }]
3351
+ for (var j = 0; j < this.myData.length; j++)
3352
+ if (this.myData[j].descrizione_valore == desc_val) {
3353
+ this.selval = "" + this.myData[j].valore;
3354
+ if (this.myData[j].descrizione_valore != null)
3355
+ this.descri_val = this.myData[j].descrizione_valore;
3356
+ this.update_dis();
3357
+ return;
3358
+ }
3359
+ this.update_dis();
3506
3360
  };
3507
- return FHUploadComponent;
3508
- }());
3509
-
3510
- /**
3511
- * @fileoverview added by tsickle
3512
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3513
- */
3514
- var AuthenticationService = /** @class */ (function () {
3515
- function AuthenticationService(_dataService, toastr, http$1, router, route, _fileService, app_s, uti_s) {
3516
- this._dataService = _dataService;
3517
- this.toastr = toastr;
3518
- this.http = http$1;
3519
- this.router = router;
3520
- this.route = route;
3521
- this._fileService = _fileService;
3522
- this.app_s = app_s;
3523
- this.uti_s = uti_s;
3524
- this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3525
- this.goto_after = "";
3526
- this.username = '';
3527
- this.headers = new http.HttpHeaders({
3528
- 'Content-Type': 'application/json',
3529
- });
3530
- }
3531
3361
  /**
3362
+ * @param {?} ind
3532
3363
  * @return {?}
3533
3364
  */
3534
- AuthenticationService.prototype.logout = /**
3365
+ FHComboboxComponent.prototype.setByIndex = /**
3366
+ * @param {?} ind
3535
3367
  * @return {?}
3536
3368
  */
3537
- function () {
3538
- this.app_s.user = null;
3539
- this.app_s.user_name = null;
3540
- this.app_s.user_surname = null;
3541
- this.app_s.user_idp = null;
3542
- this.app_s.user_email = null;
3543
- this.app_s.user_roles = null;
3544
- this.app_s.user_lang = null;
3545
- this.app_s.user_isadmin = null;
3546
- this.app_s.token = null;
3547
- localStorage.removeItem(this.app_s.COMPANY_KEY + "token");
3548
- if (this.app_s.LOGIN_EXT != 1)
3549
- this.router.navigate(['login']);
3550
- else {
3551
- window.location.href = (this.app_s.LOGOUT_URL_EXT);
3369
+ function (ind) {
3370
+ this.valDef = "";
3371
+ this.selval = '-1';
3372
+ if (this.myData == null)
3373
+ return;
3374
+ if (this.myData.length == 0 || this.myData[0] == null)
3375
+ return;
3376
+ if (this.myData.length > ind) {
3377
+ this.setByDescri(this.myData[ind].descrizione_valore);
3552
3378
  }
3553
3379
  };
3554
3380
  /**
3555
- * @param {?} username
3556
- * @param {?} password
3557
- * @param {?=} displayError
3558
3381
  * @return {?}
3559
3382
  */
3560
- AuthenticationService.prototype.login = /**
3561
- * @param {?} username
3562
- * @param {?} password
3563
- * @param {?=} displayError
3383
+ FHComboboxComponent.prototype.getObj = /**
3564
3384
  * @return {?}
3565
3385
  */
3566
- function (username, password, displayError) {
3567
- var _this = this;
3568
- if (displayError === void 0) { displayError = true; }
3569
- this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3570
- /** @type {?} */
3571
- var post_v = JSON.stringify({ username: username, password: password });
3572
- if (this.app_s.LDAP_AUTH == 1)
3573
- post_v = JSON.stringify({ username: username, password: password, ldap_auth: 1 });
3574
- return this.http.post(this.url, post_v, {
3575
- headers: this.headers
3576
- }).pipe(operators.map((/**
3577
- * @param {?} res
3578
- * @return {?}
3579
- */
3580
- function (res) {
3581
- // Handle errors, display if enabled
3582
- /** @type {?} */
3583
- var err;
3584
- if (!res) {
3585
- err = new Error('Empty server response');
3586
- }
3587
- else if (res.result_msg === 'KO') {
3588
- err = new Error(res.msg);
3589
- }
3590
- else {
3591
- if (res.result_data.length > 0) {
3592
- localStorage.setItem(_this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
3386
+ function () {
3387
+ if (this.selval == null)
3388
+ return null;
3389
+ if (this.selval == "-1")
3390
+ return null;
3391
+ else
3392
+ for (var j = 0; j < this.myData.length; j++)
3393
+ if (this.myData[j].valore == this.selval) {
3394
+ return this.myData[j];
3593
3395
  }
3396
+ };
3397
+ /**
3398
+ * @param {?} desc_val
3399
+ * @return {?}
3400
+ */
3401
+ FHComboboxComponent.prototype.setByValue = /**
3402
+ * @param {?} desc_val
3403
+ * @return {?}
3404
+ */
3405
+ function (desc_val) {
3406
+ this.valDef = desc_val;
3407
+ this.selval = '-1';
3408
+ // console.log(this.myData);
3409
+ if ("" + desc_val == "") {
3410
+ // console.log('qqq1111');
3411
+ return;
3412
+ }
3413
+ // console.log("qui");
3414
+ if (this.myData == null)
3415
+ return;
3416
+ // console.log("qui1");
3417
+ if (this.myData.length == 0 || this.myData[0] == null)
3418
+ return;
3419
+ //console.log("qui2");
3420
+ for (var j = 0; j < this.myData.length; j++) {
3421
+ //console.log(this.myData[j].valore +' '+ desc_val);
3422
+ if (this.myData[j].valore == desc_val) {
3423
+ this.selval = "" + this.myData[j].valore;
3424
+ if (this.myData[j].descrizione_valore != null)
3425
+ this.descri_val = this.myData[j].descrizione_valore;
3426
+ this.update_dis();
3427
+ return;
3594
3428
  }
3595
- if (err) {
3596
- console.error(err);
3597
- if (displayError) {
3598
- _this.toastr.error(err.message);
3429
+ }
3430
+ this.update_dis();
3431
+ };
3432
+ /**
3433
+ * @return {?}
3434
+ */
3435
+ FHComboboxComponent.prototype.getDescri = /**
3436
+ * @return {?}
3437
+ */
3438
+ function () {
3439
+ if (!this.enabled) {
3440
+ if (this.selval == null)
3441
+ return this.valDef;
3442
+ if (this.selval == "-1")
3443
+ return this.valDef;
3444
+ }
3445
+ if (this.selval == null)
3446
+ return "-1";
3447
+ if (this.selval == "-1")
3448
+ return "-1";
3449
+ else
3450
+ for (var j = 0; j < this.myData.length; j++)
3451
+ if (this.myData[j].valore == this.selval) {
3452
+ return this.myData[j].descrizione_valore;
3599
3453
  }
3600
- throw new Error(err);
3601
- }
3602
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3603
- })), operators.catchError((/**
3604
- * @param {?} err
3605
- * @return {?}
3606
- */
3607
- function (err) {
3608
- // In a real world app, we might use a remote logging infrastructure
3609
- // We'd also dig deeper into the error to get a better message
3610
- /** @type {?} */
3611
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3612
- console.error(errMsg); // log to console instead
3613
- throw err;
3614
- })));
3615
3454
  };
3616
3455
  /**
3617
- * @param {?} username
3618
- * @param {?=} displayError
3619
3456
  * @return {?}
3620
3457
  */
3621
- AuthenticationService.prototype.get_user_info = /**
3622
- * @param {?} username
3623
- * @param {?=} displayError
3458
+ FHComboboxComponent.prototype.getValue = /**
3624
3459
  * @return {?}
3625
3460
  */
3626
- function (username, displayError) {
3627
- var _this = this;
3628
- if (displayError === void 0) { displayError = true; }
3629
- this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3630
- /** @type {?} */
3631
- var post_v = JSON.stringify({ username_info: username });
3632
- return this.http.post(this.url, post_v, {
3633
- headers: this.headers
3634
- }).pipe(operators.map((/**
3635
- * @param {?} res
3636
- * @return {?}
3637
- */
3638
- function (res) {
3639
- // Handle errors, display if enabled
3640
- /** @type {?} */
3641
- var err;
3642
- if (!res) {
3643
- err = new Error('Empty server response');
3644
- }
3645
- else if (res.result_msg === 'KO') {
3646
- err = new Error(res.msg);
3461
+ function () {
3462
+ // console.log(this.selval);
3463
+ if (!this.enabled) {
3464
+ if (this.selval == null)
3465
+ return this.valDef;
3466
+ if (this.selval == "-1")
3467
+ return this.valDef;
3468
+ }
3469
+ if (this.selval == null)
3470
+ return "-1";
3471
+ if (this.selval == "")
3472
+ return "-1";
3473
+ else
3474
+ return this.selval;
3475
+ };
3476
+ /**
3477
+ * @param {?} campo
3478
+ * @return {?}
3479
+ */
3480
+ FHComboboxComponent.prototype.getData = /**
3481
+ * @param {?} campo
3482
+ * @return {?}
3483
+ */
3484
+ function (campo) {
3485
+ for (var x in this.myData) {
3486
+ if (this.myData[x]['valore'] == this.selval) {
3487
+ return (this.myData[x][campo]);
3647
3488
  }
3648
- if (err) {
3649
- console.error(err);
3650
- if (displayError) {
3651
- _this.toastr.error(err.message);
3652
- }
3653
- throw new Error(err);
3489
+ else {
3490
+ continue;
3654
3491
  }
3655
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3656
- })), operators.catchError((/**
3657
- * @param {?} err
3658
- * @return {?}
3659
- */
3660
- function (err) {
3661
- // In a real world app, we might use a remote logging infrastructure
3662
- // We'd also dig deeper into the error to get a better message
3663
- /** @type {?} */
3664
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3665
- console.error(errMsg); // log to console instead
3666
- throw err;
3667
- })));
3492
+ }
3668
3493
  };
3669
3494
  /**
3670
- * @param {?} email
3671
- * @param {?=} displayError
3495
+ * @param {?} s
3672
3496
  * @return {?}
3673
3497
  */
3674
- AuthenticationService.prototype.passrecovery = /**
3675
- * @param {?} email
3676
- * @param {?=} displayError
3498
+ FHComboboxComponent.prototype.set_options = /**
3499
+ * @param {?} s
3677
3500
  * @return {?}
3678
3501
  */
3679
- function (email, displayError) {
3680
- var _this = this;
3681
- if (displayError === void 0) { displayError = true; }
3502
+ function (s) {
3503
+ this.myData = new Array();
3682
3504
  /** @type {?} */
3683
- var post_v = JSON.stringify({ email: email, websiteroot: this.app_s.COMPANY_SITE_ROOT, op: 'send_email' });
3684
- return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
3685
- headers: this.headers
3686
- }).pipe(operators.map((/**
3687
- * @param {?} res
3688
- * @return {?}
3689
- */
3690
- function (res) {
3691
- // Handle errors, display if enabled
3505
+ var a = s.split('$');
3506
+ for (var i = 0; i < a.length; i++) {
3692
3507
  /** @type {?} */
3693
- var err;
3694
- if (!res) {
3695
- err = new Error('Empty server response');
3696
- }
3697
- else if (res.result_msg === 'KO') {
3698
- err = new Error(res.msg);
3699
- }
3700
- if (err) {
3701
- console.error(err);
3702
- if (displayError) {
3703
- _this.toastr.error(err.message);
3704
- }
3705
- throw new Error(err);
3706
- }
3707
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3708
- })), operators.catchError((/**
3709
- * @param {?} err
3710
- * @return {?}
3711
- */
3712
- function (err) {
3713
- // In a real world app, we might use a remote logging infrastructure
3714
- // We'd also dig deeper into the error to get a better message
3508
+ var o = new Object();
3715
3509
  /** @type {?} */
3716
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3717
- console.error(errMsg); // log to console instead
3718
- throw err;
3719
- })));
3510
+ var av = a[i].split('|');
3511
+ o.valore = av[1];
3512
+ o.descrizione_valore = av[0];
3513
+ this
3514
+ .myData
3515
+ .push(o);
3516
+ }
3517
+ this.setByValue(this.valDef);
3518
+ if (this.getValue() == "-1")
3519
+ this.setByDescri(this.valDef);
3720
3520
  };
3721
3521
  /**
3722
- * @param {?} res_rep
3723
- * @param {?=} displayError
3724
3522
  * @return {?}
3725
3523
  */
3726
- AuthenticationService.prototype.checktoken = /**
3727
- * @param {?} res_rep
3728
- * @param {?=} displayError
3729
- * @return {?}
3730
- */
3731
- function (res_rep, displayError) {
3732
- var _this = this;
3733
- if (displayError === void 0) { displayError = true; }
3734
- /** @type {?} */
3735
- var post_v = JSON.stringify({ res_rep: res_rep, op: 'check_token' });
3736
- return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
3737
- headers: this.headers
3738
- }).pipe(operators.map((/**
3739
- * @param {?} res
3740
- * @return {?}
3741
- */
3742
- function (res) {
3743
- // Handle errors, display if enabled
3744
- /** @type {?} */
3745
- var err;
3746
- if (!res) {
3747
- err = new Error('Empty server response');
3748
- }
3749
- else if (res.result_msg === 'KO') {
3750
- err = new Error(res.msg);
3751
- }
3752
- if (err) {
3753
- console.error(err);
3754
- if (displayError) {
3755
- _this.toastr.error(err.message);
3756
- }
3757
- throw new Error(err);
3758
- }
3759
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3760
- })), operators.catchError((/**
3761
- * @param {?} err
3762
- * @return {?}
3763
- */
3764
- function (err) {
3765
- // In a real world app, we might use a remote logging infrastructure
3766
- // We'd also dig deeper into the error to get a better message
3767
- /** @type {?} */
3768
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3769
- console.error(errMsg); // log to console instead
3770
- throw err;
3771
- })));
3772
- };
3773
- /**
3774
- * @param {?} token
3775
- * @param {?} password
3776
- * @param {?=} displayError
3777
- * @return {?}
3778
- */
3779
- AuthenticationService.prototype.change_password = /**
3780
- * @param {?} token
3781
- * @param {?} password
3782
- * @param {?=} displayError
3783
- * @return {?}
3784
- */
3785
- function (token, password, displayError) {
3786
- var _this = this;
3787
- if (displayError === void 0) { displayError = true; }
3788
- /** @type {?} */
3789
- var post_v = JSON.stringify({ token: token, password: password, op: 'change_password' });
3790
- return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
3791
- headers: this.headers
3792
- }).pipe(operators.map((/**
3793
- * @param {?} res
3794
- * @return {?}
3795
- */
3796
- function (res) {
3797
- // Handle errors, display if enabled
3798
- /** @type {?} */
3799
- var err;
3800
- if (!res) {
3801
- err = new Error('Empty server response');
3802
- }
3803
- else if (res.result_msg === 'KO') {
3804
- err = new Error(res.msg);
3805
- }
3806
- if (err) {
3807
- console.error(err);
3808
- if (displayError) {
3809
- _this.toastr.error(err.message);
3810
- }
3811
- throw new Error(err);
3812
- }
3813
- return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
3814
- })), operators.catchError((/**
3815
- * @param {?} err
3816
- * @return {?}
3817
- */
3818
- function (err) {
3819
- // In a real world app, we might use a remote logging infrastructure
3820
- // We'd also dig deeper into the error to get a better message
3821
- /** @type {?} */
3822
- var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
3823
- console.error(errMsg); // log to console instead
3824
- throw err;
3825
- })));
3826
- };
3827
- /**
3828
- * @return {?}
3829
- */
3830
- AuthenticationService.prototype.checkCredentials_toLogin = /**
3524
+ FHComboboxComponent.prototype.ngAfterViewInit = /**
3831
3525
  * @return {?}
3832
3526
  */
3833
3527
  function () {
3834
- if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
3835
- this.goto_after = window.location.toString();
3836
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
3837
- if (this.router.url.indexOf('/rp/') == -1)
3838
- this.router.navigate(['login']);
3839
- return false;
3840
- }
3841
- return true;
3528
+ // console.log("ngAfterViewInit"); console.log(this.init_fill);
3842
3529
  };
3843
3530
  /**
3844
3531
  * @return {?}
3845
3532
  */
3846
- AuthenticationService.prototype.checkCredentials = /**
3533
+ FHComboboxComponent.prototype.ngOnInit = /**
3847
3534
  * @return {?}
3848
3535
  */
3849
3536
  function () {
3850
- if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
3851
- this.goto_after = window.location.toString();
3852
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
3853
- return false;
3537
+ if (this.init_fill == true) {
3538
+ if (this.sql == '') {
3539
+ //this.errorMsg="QUERY NON CONFIGURATA";
3540
+ return;
3541
+ }
3542
+ this.fillCombo();
3854
3543
  }
3855
- return true;
3856
- };
3857
- AuthenticationService.decorators = [
3858
- { type: core.Injectable, args: [{
3859
- providedIn: 'root',
3860
- },] }
3861
- ];
3862
- /** @nocollapse */
3863
- AuthenticationService.ctorParameters = function () { return [
3864
- { type: QueryService },
3865
- { type: ngxToastr.ToastrService },
3866
- { type: http.HttpClient },
3867
- { type: router.Router },
3868
- { type: router.ActivatedRoute },
3869
- { type: FileService },
3870
- { type: AppService },
3871
- { type: UtilityService }
3872
- ]; };
3873
- /** @nocollapse */ AuthenticationService.ngInjectableDef = core.defineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(core.inject(QueryService), core.inject(ngxToastr.ToastrService), core.inject(http.HttpClient), core.inject(router.Router), core.inject(router.ActivatedRoute), core.inject(FileService), core.inject(AppService), core.inject(UtilityService)); }, token: AuthenticationService, providedIn: "root" });
3874
- return AuthenticationService;
3875
- }());
3876
-
3877
- /**
3878
- * @fileoverview added by tsickle
3879
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3880
- */
3881
- var WinAskTextBigComponent = /** @class */ (function () {
3882
- function WinAskTextBigComponent(dialogRef, toastr) {
3883
- this.dialogRef = dialogRef;
3884
- this.toastr = toastr;
3885
- this.title = "";
3886
- this.label = "";
3887
- this.valore = "";
3888
- this.readonly = false;
3889
- this.show_annulla = true;
3890
- this.show_ok = true;
3891
- this.min_chars = 3;
3892
- }
3893
- /**
3894
- * @return {?}
3895
- */
3896
- WinAskTextBigComponent.prototype.ngOnInit = /**
3897
- * @return {?}
3898
- */
3899
- function () {
3900
- };
3901
- /**
3902
- * @return {?}
3903
- */
3904
- WinAskTextBigComponent.prototype.show = /**
3905
- * @return {?}
3906
- */
3907
- function () {
3908
- };
3909
- /**
3910
- * @return {?}
3911
- */
3912
- WinAskTextBigComponent.prototype.hide = /**
3913
- * @return {?}
3914
- */
3915
- function () {
3916
- this.dialogRef.close(null);
3917
- };
3918
- /**
3919
- * @return {?}
3920
- */
3921
- WinAskTextBigComponent.prototype.do_check = /**
3922
- * @return {?}
3923
- */
3924
- function () {
3925
- if (this.valore.length < this.min_chars) {
3926
- this.toastr.error('Il valore deve contenere almeno ' + this.min_chars + ' caratteri');
3927
- return;
3544
+ else {
3545
+ this.errorMsg = "";
3928
3546
  }
3929
- this.dialogRef.close(this.valore);
3547
+ this
3548
+ .initend
3549
+ .emit();
3930
3550
  };
3931
3551
  /**
3932
3552
  * @return {?}
3933
3553
  */
3934
- WinAskTextBigComponent.prototype.chiudi = /**
3554
+ FHComboboxComponent.prototype.sc = /**
3935
3555
  * @return {?}
3936
3556
  */
3937
3557
  function () {
3938
- this.dialogRef.close(null);
3558
+ this
3559
+ .selchange
3560
+ .emit({ event: this.getObj(), valore: this.getValue(), descrizione_valore: this.getDescri() });
3939
3561
  };
3940
- WinAskTextBigComponent.decorators = [
3562
+ FHComboboxComponent.decorators = [
3941
3563
  { type: core.Component, args: [{
3942
- selector: 'app-win_ask_text',
3943
- 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 "
3564
+ 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 ",
3565
+ styles: ["\n\n "]
3944
3566
  }] }
3945
3567
  ];
3946
3568
  /** @nocollapse */
3947
- WinAskTextBigComponent.ctorParameters = function () { return [
3948
- { type: material.MatDialogRef },
3949
- { type: ngxToastr.ToastrService }
3569
+ FHComboboxComponent.ctorParameters = function () { return [
3570
+ { type: QueryService },
3571
+ { type: OdbcService }
3950
3572
  ]; };
3951
- WinAskTextBigComponent.propDecorators = {
3952
- title: [{ type: core.Input }],
3573
+ FHComboboxComponent.propDecorators = {
3574
+ init_fill: [{ type: core.Input }],
3575
+ sql: [{ type: core.Input }],
3576
+ types: [{ type: core.Input }],
3577
+ values: [{ type: core.Input }],
3578
+ hidden: [{ type: core.Input }],
3953
3579
  label: [{ type: core.Input }],
3954
- valore: [{ type: core.Input }],
3955
- readonly: [{ type: core.Input }],
3956
- show_annulla: [{ type: core.Input }],
3957
- show_ok: [{ type: core.Input }]
3580
+ enabled: [{ type: core.Input }],
3581
+ required: [{ type: core.Input }],
3582
+ sel_label: [{ type: core.Input }],
3583
+ smtr: [{ type: core.ViewChild, args: ['cmb',] }],
3584
+ fillend: [{ type: core.Output }],
3585
+ selchange: [{ type: core.Output }],
3586
+ initend: [{ type: core.Output }],
3587
+ valDef: [{ type: core.Input }],
3588
+ db_type: [{ type: core.Input }]
3958
3589
  };
3959
- return WinAskTextBigComponent;
3590
+ return FHComboboxComponent;
3960
3591
  }());
3961
3592
 
3962
3593
  /**
3963
3594
  * @fileoverview added by tsickle
3964
3595
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3965
3596
  */
3966
- var FHUploadPanelComponent = /** @class */ (function () {
3967
- function FHUploadPanelComponent(_appservice, _dataService, toastr, dialog, auth_s, uti) {
3968
- this._appservice = _appservice;
3597
+ var FHUploadComponent = /** @class */ (function () {
3598
+ function FHUploadComponent(_dataService, toastr, dialog, app_s) {
3599
+ var _this = this;
3969
3600
  this._dataService = _dataService;
3970
3601
  this.toastr = toastr;
3971
3602
  this.dialog = dialog;
3972
- this.auth_s = auth_s;
3973
- this.uti = uti;
3603
+ this.app_s = app_s;
3604
+ this.show_descri = true;
3974
3605
  this.enabled = true;
3975
- this.label = '';
3976
- this.sovrascrivi_path = '';
3977
- this.ruolo_supervisore = '[ZZZ_DIS_CC]';
3978
- this.access_control = false;
3979
- this.show_images = true;
3980
- this.change = new core.EventEmitter();
3981
- this.App = '';
3982
- this.K = '';
3983
- this.image_type = false;
3606
+ this.single = true;
3607
+ this.descri_obb = false;
3608
+ this.programma_da_eseguire = '';
3609
+ this.label_attendere = 'ATTENDERE UPLOAD IN CORSO';
3610
+ this.fixed_label = ' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)';
3611
+ this.limit_string = 'Il file di <size>MB supera il limite di 500MB';
3612
+ this.allegato_inserito = 'ALLEGATO INSERITO';
3613
+ this.inserire_descrizione = 'Descrizione Obbligatoria';
3614
+ this.lista_allegati = [];
3615
+ this.change = new core.EventEmitter();
3616
+ this.upload_ended = new core.EventEmitter();
3617
+ this.multi_list = false;
3618
+ this.allow_delete = false;
3619
+ this.loading = false;
3620
+ this.App = '';
3621
+ this.K = '';
3622
+ this.label_b = "";
3623
+ this.descrizione = '';
3624
+ this.file_name = '';
3625
+ this.label = '';
3626
+ this.username = '';
3984
3627
  this.b_edit_loaded = false;
3985
- this.b_False = false;
3986
- this.b_mobile = false;
3628
+ this.tipo = '';
3987
3629
  this.b_ini = false;
3988
- this.m_p_tipo = "";
3989
- this.m_programma_da_eseguire = "";
3990
- }
3991
- /**
3992
- * @param {?} ax
3993
- * @return {?}
3994
- */
3995
- FHUploadPanelComponent.prototype.download_all = /**
3996
- * @param {?} ax
3997
- * @return {?}
3998
- */
3999
- function (ax) {
4000
- if (ax.APP != null)
4001
- ax.App = ax.APP;
4002
- if (this.sovrascrivi_path == '') {
4003
- window.open(this._appservice.COMPANY_SITE_ROOT + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
4004
- }
4005
- else {
4006
- window.open(this.sovrascrivi_path + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
4007
- }
4008
- };
4009
- /**
4010
- * @param {?} ax
4011
- * @return {?}
4012
- */
4013
- FHUploadPanelComponent.prototype.edit_descri = /**
4014
- * @param {?} ax
4015
- * @return {?}
4016
- */
4017
- function (ax) {
4018
- var _this = this;
4019
- /** @type {?} */
4020
- var dialogRef = this
4021
- .dialog
4022
- .open(WinAskTextBigComponent);
4023
- dialogRef.componentInstance.label = "Descrizione Allegato";
4024
- dialogRef.componentInstance.valore = ax.descrizione;
4025
- dialogRef.componentInstance.min_chars = 0;
4026
- dialogRef
4027
- .afterClosed()
4028
- .subscribe((/**
4029
- * @param {?} result
3630
+ this.uploader = new ng2FileUpload.FileUploader({
3631
+ url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT,
3632
+ 'maxFileSize': 500 * 1024 * 1024
3633
+ });
3634
+ this.id = null;
3635
+ this.username = this.app_s.user;
3636
+ this.uploader.onBeforeUploadItem = (/**
3637
+ * @param {?} item
4030
3638
  * @return {?}
4031
3639
  */
4032
- function (result) {
4033
- if (result != null) {
4034
- /** @type {?} */
4035
- var p = new QParam();
4036
- p.sql = "UPDATE_ALLEGATI_DESCRIZIONE";
4037
- p.types = ['int', 'string'];
4038
- p.values = [ax.id, result];
4039
- _this
4040
- ._dataService
4041
- .doQuery(p)
4042
- .subscribe((/**
4043
- * @param {?} data
4044
- * @return {?}
4045
- */
4046
- function (data) {
4047
- if (data != null)
4048
- if (data.result_msg == "OK") {
4049
- _this.ref_allegato();
4050
- }
4051
- }));
3640
+ function (item) {
3641
+ item.withCredentials = false;
3642
+ });
3643
+ this.uploader.onCompleteItem = (/**
3644
+ * @param {?} item
3645
+ * @param {?} response
3646
+ * @param {?} status
3647
+ * @param {?} header
3648
+ * @return {?}
3649
+ */
3650
+ function (item, response, status, header) {
3651
+ if (status === 200) {
3652
+ _this.descrizione = '';
3653
+ _this.toastr.info("INFO", _this.allegato_inserito, {
3654
+ timeOut: 1000,
3655
+ progressBar: true
3656
+ });
3657
+ _this.ref_allegato();
3658
+ _this.change.emit({ item: item, response: response, status: status, header: header });
4052
3659
  }
4053
- }));
4054
- };
3660
+ });
3661
+ }
4055
3662
  /**
4056
- * @param {?} ax
4057
3663
  * @return {?}
4058
3664
  */
4059
- FHUploadPanelComponent.prototype.delete = /**
4060
- * @param {?} ax
3665
+ FHUploadComponent.prototype.del_doc = /**
4061
3666
  * @return {?}
4062
3667
  */
4063
- function (ax) {
3668
+ function () {
4064
3669
  var _this = this;
4065
- localStorage.setItem(this._appservice.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
4066
- localStorage.setItem(this._appservice.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
3670
+ localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
3671
+ localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
4067
3672
  /** @type {?} */
4068
3673
  var dialogRef = this
4069
3674
  .dialog
@@ -4080,7 +3685,7 @@
4080
3685
  var p = new QParam();
4081
3686
  p.sql = "DELETE_ALLEGATO";
4082
3687
  p.types = ['int', 'string'];
4083
- p.values = [ax.id, _this.auth_s.username];
3688
+ p.values = [_this.id, _this.app_s.user];
4084
3689
  _this
4085
3690
  ._dataService
4086
3691
  .doQuery(p)
@@ -4112,183 +3717,539 @@
4112
3717
  /**
4113
3718
  * @return {?}
4114
3719
  */
4115
- FHUploadPanelComponent.prototype.ngOnInit = /**
3720
+ FHUploadComponent.prototype.ngOnInit = /**
4116
3721
  * @return {?}
4117
3722
  */
4118
3723
  function () {
4119
- this.upc.single = false;
4120
- this.b_mobile = this._appservice.getState().pageFullscreen;
4121
- this
4122
- .upc
4123
- .init(this.App, this.K, 'Descrizione Allegato', this.m_p_tipo, this.m_programma_da_eseguire);
4124
- this.ref_allegato();
3724
+ var _this = this;
3725
+ /** @type {?} */
3726
+ var uo = {};
3727
+ uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
3728
+ // console.log('ngOnInit!!');
3729
+ if (this.multi_list)
3730
+ setTimeout((/**
3731
+ * @return {?}
3732
+ */
3733
+ function () { _this.cmb_tipo.fillCombo(); }), 100);
3734
+ this.uploader.setOptions(uo);
3735
+ this.uploader.onCompleteAll = (/**
3736
+ * @return {?}
3737
+ */
3738
+ function () {
3739
+ _this.loading = false;
3740
+ _this.upload_ended.emit();
3741
+ if (_this.dialogRef != null)
3742
+ if (_this.dialogRef.componentInstance != null) {
3743
+ _this.dialogRef.componentInstance.update_progess(100);
3744
+ _this.dialogRef = null;
3745
+ }
3746
+ });
3747
+ this.uploader.onErrorItem = (/**
3748
+ * @param {?} a
3749
+ * @param {?} b
3750
+ * @param {?} c
3751
+ * @param {?} d
3752
+ * @return {?}
3753
+ */
3754
+ function (a, b, c, d) {
3755
+ _this.toastr.error(b);
3756
+ });
3757
+ this.uploader.onAfterAddingFile = (/**
3758
+ * @param {?} fileItem
3759
+ * @return {?}
3760
+ */
3761
+ function (fileItem) {
3762
+ _this.ch(fileItem);
3763
+ });
3764
+ this.uploader.onProgressItem = (/**
3765
+ * @param {?} fileItem
3766
+ * @param {?} progress
3767
+ * @return {?}
3768
+ */
3769
+ function (fileItem, progress) {
3770
+ // console.log(fileItem);
3771
+ // console.log(progress);
3772
+ _this.loading = true;
3773
+ if (_this.dialogRef != null)
3774
+ if (_this.dialogRef.componentInstance != null)
3775
+ _this.dialogRef.componentInstance.update_progess(progress);
3776
+ });
3777
+ this.uploader.onWhenAddingFileFailed = (/**
3778
+ * @param {?} item
3779
+ * @param {?} filter
3780
+ * @param {?} options
3781
+ * @return {?}
3782
+ */
3783
+ function (item, filter, options) {
3784
+ switch (filter.name) {
3785
+ case 'fileSize':
3786
+ /** @type {?} */
3787
+ var ar = Math.round(item.size / 1024 / 1024);
3788
+ _this.toastr.error(_this.limit_string.split('<size>').join('' + ar));
3789
+ break;
3790
+ default:
3791
+ _this.toastr.error("Errore: " + filter.name);
3792
+ }
3793
+ });
4125
3794
  };
4126
3795
  /**
4127
- * @param {?} p_app
4128
- * @param {?} p_k
4129
- * @param {?=} p_tipo
4130
- * @param {?=} programma_da_eseguire
4131
3796
  * @return {?}
4132
3797
  */
4133
- FHUploadPanelComponent.prototype.init = /**
4134
- * @param {?} p_app
4135
- * @param {?} p_k
4136
- * @param {?=} p_tipo
4137
- * @param {?=} programma_da_eseguire
3798
+ FHUploadComponent.prototype.download_all = /**
4138
3799
  * @return {?}
4139
3800
  */
4140
- function (p_app, p_k, p_tipo, programma_da_eseguire) {
4141
- if (p_tipo === void 0) { p_tipo = ""; }
4142
- if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
4143
- this.App = p_app;
4144
- this.K = p_k;
4145
- this.b_ini = true;
4146
- this.b_edit_loaded = false;
4147
- this.m_p_tipo = p_tipo;
4148
- this.m_programma_da_eseguire = programma_da_eseguire;
4149
- this.ngOnInit();
3801
+ function () {
3802
+ window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + this.App + '/' + this.K + '/' + this.file_name);
4150
3803
  };
4151
3804
  /**
3805
+ * @param {?} fileItem
4152
3806
  * @return {?}
4153
3807
  */
4154
- FHUploadPanelComponent.prototype.ref_allegato = /**
3808
+ FHUploadComponent.prototype.ch = /**
3809
+ * @param {?} fileItem
4155
3810
  * @return {?}
4156
3811
  */
4157
- function () {
3812
+ function (fileItem) {
4158
3813
  var _this = this;
4159
- if (this.App == null)
4160
- return;
4161
- if (this.App == "")
3814
+ if (this.descri_obb && this.descrizione == '') {
3815
+ this.toastr.error(this.inserire_descrizione);
4162
3816
  return;
4163
- /** @type {?} */
4164
- var p = new QParam();
4165
- p.sql = "SELECT_ALLEGATO_INFO";
4166
- p.types = ['string', 'string'];
4167
- p.values = [this.App, this.K];
4168
- this
4169
- ._dataService
4170
- .doQuery(p)
4171
- .subscribe((/**
4172
- * @param {?} data
3817
+ }
3818
+ for (var i = 0; i < this.lista_allegati.length; i++) {
3819
+ if (this.lista_allegati[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
3820
+ this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
3821
+ return;
3822
+ }
3823
+ }
3824
+ this.uploader.onBuildItemForm = (/**
3825
+ * @param {?} item
3826
+ * @param {?} form
3827
+ * @return {?}
3828
+ */
3829
+ function (item, form) {
3830
+ form.append('App', _this.App);
3831
+ form.append('K', _this.K);
3832
+ form.append('descrizione', _this.descrizione);
3833
+ form.append('single', _this.single);
3834
+ form.append('username', _this.username);
3835
+ if (_this.multi_list)
3836
+ form.append('tipo', _this.cmb_tipo.getDescri().split('-1').join(''));
3837
+ else
3838
+ form.append('tipo', _this.tipo);
3839
+ form.append('local_path', _this.app_s.LOCAL_PATH);
3840
+ if (_this.programma_da_eseguire != '')
3841
+ form.append('p1', _this.programma_da_eseguire);
3842
+ });
3843
+ if (this.dialogRef == null) {
3844
+ this.dialogRef = this.dialog.open(WinWait, { 'disableClose': true });
3845
+ this.dialogRef.componentInstance.label = this.label_attendere;
3846
+ this.dialogRef.afterClosed().subscribe((/**
3847
+ * @param {?} result
3848
+ * @return {?}
3849
+ */
3850
+ function (result) {
3851
+ }));
3852
+ }
3853
+ this.uploader.uploadAll();
3854
+ };
3855
+ /**
3856
+ * @param {?} p_app
3857
+ * @param {?} p_k
3858
+ * @param {?} p_label
3859
+ * @param {?=} p_tipo
3860
+ * @param {?=} programma_da_eseguire
3861
+ * @param {?=} allow_delete
3862
+ * @return {?}
3863
+ */
3864
+ FHUploadComponent.prototype.init = /**
3865
+ * @param {?} p_app
3866
+ * @param {?} p_k
3867
+ * @param {?} p_label
3868
+ * @param {?=} p_tipo
3869
+ * @param {?=} programma_da_eseguire
3870
+ * @param {?=} allow_delete
3871
+ * @return {?}
3872
+ */
3873
+ function (p_app, p_k, p_label, p_tipo, programma_da_eseguire, allow_delete) {
3874
+ if (p_tipo === void 0) { p_tipo = ""; }
3875
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
3876
+ if (allow_delete === void 0) { allow_delete = false; }
3877
+ this.App = p_app;
3878
+ this.K = p_k;
3879
+ this.label = p_label;
3880
+ this.tipo = p_tipo;
3881
+ this.b_ini = true;
3882
+ this.b_edit_loaded = false;
3883
+ this.descrizione = '';
3884
+ this.programma_da_eseguire = programma_da_eseguire;
3885
+ this.allow_delete = allow_delete;
3886
+ this.ref_allegato();
3887
+ // console.log('init! ',this.tipo)
3888
+ if (this.tipo.indexOf('SELECT_') > -1) {
3889
+ this.multi_list = true;
3890
+ //console.log('fillCombo');
3891
+ }
3892
+ };
3893
+ /**
3894
+ * @return {?}
3895
+ */
3896
+ FHUploadComponent.prototype.ref_allegato = /**
3897
+ * @return {?}
3898
+ */
3899
+ function () {
3900
+ var _this = this;
3901
+ // console.log(' ref_allegato')
3902
+ this.id = null;
3903
+ this.descrizione = '';
3904
+ this.file_name = '';
3905
+ this.label_b = '';
3906
+ this.cmb_tipo.resetValue();
3907
+ if (!this.single)
3908
+ return;
3909
+ if (this.App == null)
3910
+ return;
3911
+ if (this.App == "")
3912
+ return;
3913
+ /** @type {?} */
3914
+ var p = new QParam();
3915
+ p.sql = "SELECT_ALLEGATO_INFO";
3916
+ p.types = ['string', 'string'];
3917
+ p.values = [this.App, this.K];
3918
+ this._dataService.doQuery(p).subscribe((/**
3919
+ * @param {?} data
4173
3920
  * @return {?}
4174
3921
  */
4175
3922
  function (data) {
4176
3923
  if (data != null)
4177
3924
  if (data.result_msg == "OK") {
4178
- _this.arr_g = data.result_data;
4179
3925
  /** @type {?} */
4180
- var iconf = "webinfo";
4181
- for (var i = 0; i < _this.arr_g.length; i++) {
4182
- if (_this.arr_g[i].APP != null)
4183
- _this.arr_g[i].App = _this.arr_g[i].APP;
4184
- if (_this.arr_g[i].descrizione != null)
4185
- _this.arr_g[i].descrizione_vis = _this.arr_g[i].descrizione.split('\n').join('<br>');
4186
- else
4187
- _this.arr_g[i].descrizione_vis = '';
4188
- /** @type {?} */
4189
- var arrf = _this.arr_g[i].Filename.split('.');
4190
- if (_this.sovrascrivi_path == '') {
4191
- _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;
4192
- _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;
4193
- }
4194
- else {
4195
- _this.arr_g[i].url = _this.sovrascrivi_path + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4196
- _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;
4197
- }
4198
- 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)
4199
- iconf = arrf[arrf.length - 1].toLocaleLowerCase();
4200
- _this.arr_g[i].icon = iconf + '.svg';
4201
- _this.arr_g[i].can_delete = !_this.access_control || _this.arr_g[i].idp == _this._appservice.user || _this.uti.hasRole(_this.ruolo_supervisore);
4202
- 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) {
4203
- _this.arr_g[i].type = "IMG";
4204
- _this.arr_g[i].image_original = [_this.arr_g[i].url];
4205
- if (_this.arr_g[i].preview != null)
4206
- if (_this.arr_g[i].preview == 1) {
4207
- /** @type {?} */
4208
- var pcs = _this.arr_g[i].url.split('.');
4209
- /** @type {?} */
4210
- var lastPc = pcs.pop();
4211
- _this.arr_g[i].url = pcs.join('.') + '_preview.' + lastPc;
4212
- }
4213
- _this.image_type = true;
4214
- _this.arr_g[i].image_thumbnail = [_this.arr_g[i].url];
4215
- }
4216
- else
4217
- _this.arr_g[i].type = "O";
3926
+ var a = data.result_data;
3927
+ if (a.length > 0) {
3928
+ _this.id = a[0].id;
3929
+ _this.descrizione = a[0].descrizione;
3930
+ _this.file_name = a[0].Filename;
3931
+ _this.label_b = "" + a[0].Filename + " - " + a[0].Filesize + "";
3932
+ _this.b_edit_loaded = true;
4218
3933
  }
4219
3934
  }
4220
3935
  }));
4221
3936
  };
4222
- FHUploadPanelComponent.decorators = [
3937
+ FHUploadComponent.decorators = [
4223
3938
  { type: core.Component, args: [{
4224
- 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 ",
4225
- styles: ["\n\n\n\n "]
3939
+ selector: 'FHUpload',
3940
+ 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 ",
3941
+ styles: ["\n\n "]
4226
3942
  }] }
4227
3943
  ];
4228
3944
  /** @nocollapse */
4229
- FHUploadPanelComponent.ctorParameters = function () { return [
4230
- { type: AppService },
3945
+ FHUploadComponent.ctorParameters = function () { return [
4231
3946
  { type: QueryService },
4232
3947
  { type: ngxToastr.ToastrService },
4233
3948
  { type: material.MatDialog },
4234
- { type: AuthenticationService },
4235
- { type: UtilityService }
3949
+ { type: AppService }
4236
3950
  ]; };
4237
- FHUploadPanelComponent.propDecorators = {
3951
+ FHUploadComponent.propDecorators = {
3952
+ show_descri: [{ type: core.Input }],
4238
3953
  enabled: [{ type: core.Input }],
4239
- label: [{ type: core.Input }],
4240
- sovrascrivi_path: [{ type: core.Input }],
4241
- ruolo_supervisore: [{ type: core.Input }],
4242
- access_control: [{ type: core.Input }],
4243
- show_images: [{ type: core.Input }],
3954
+ single: [{ type: core.Input }],
3955
+ descri_obb: [{ type: core.Input }],
3956
+ programma_da_eseguire: [{ type: core.Input }],
3957
+ label_attendere: [{ type: core.Input }],
3958
+ fixed_label: [{ type: core.Input }],
3959
+ limit_string: [{ type: core.Input }],
3960
+ allegato_inserito: [{ type: core.Input }],
3961
+ inserire_descrizione: [{ type: core.Input }],
3962
+ lista_allegati: [{ type: core.Input }],
4244
3963
  change: [{ type: core.Output }],
4245
- upc: [{ type: core.ViewChild, args: ['upc',] }]
3964
+ upload_ended: [{ type: core.Output }],
3965
+ cmb_tipo: [{ type: core.ViewChild, args: ['cmb_tipo',] }]
3966
+ };
3967
+ return FHUploadComponent;
3968
+ }());
3969
+
3970
+ /**
3971
+ * @fileoverview added by tsickle
3972
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3973
+ */
3974
+ var AuthenticationService = /** @class */ (function () {
3975
+ function AuthenticationService(_dataService, toastr, http$1, router, route, _fileService, app_s, uti_s) {
3976
+ this._dataService = _dataService;
3977
+ this.toastr = toastr;
3978
+ this.http = http$1;
3979
+ this.router = router;
3980
+ this.route = route;
3981
+ this._fileService = _fileService;
3982
+ this.app_s = app_s;
3983
+ this.uti_s = uti_s;
3984
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
3985
+ this.goto_after = "";
3986
+ this.username = '';
3987
+ this.headers = new http.HttpHeaders({
3988
+ 'Content-Type': 'application/json',
3989
+ });
3990
+ }
3991
+ /**
3992
+ * @return {?}
3993
+ */
3994
+ AuthenticationService.prototype.logout = /**
3995
+ * @return {?}
3996
+ */
3997
+ function () {
3998
+ this.app_s.user = null;
3999
+ this.app_s.user_name = null;
4000
+ this.app_s.user_surname = null;
4001
+ this.app_s.user_idp = null;
4002
+ this.app_s.user_email = null;
4003
+ this.app_s.user_roles = null;
4004
+ this.app_s.user_lang = null;
4005
+ this.app_s.user_isadmin = null;
4006
+ this.app_s.token = null;
4007
+ localStorage.removeItem(this.app_s.COMPANY_KEY + "token");
4008
+ if (this.app_s.LOGIN_EXT != 1)
4009
+ this.router.navigate(['login']);
4010
+ else {
4011
+ window.location.href = (this.app_s.LOGOUT_URL_EXT);
4012
+ }
4013
+ };
4014
+ /**
4015
+ * @param {?} username
4016
+ * @param {?} password
4017
+ * @param {?=} displayError
4018
+ * @return {?}
4019
+ */
4020
+ AuthenticationService.prototype.login = /**
4021
+ * @param {?} username
4022
+ * @param {?} password
4023
+ * @param {?=} displayError
4024
+ * @return {?}
4025
+ */
4026
+ function (username, password, displayError) {
4027
+ var _this = this;
4028
+ if (displayError === void 0) { displayError = true; }
4029
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
4030
+ /** @type {?} */
4031
+ var post_v = JSON.stringify({ username: username, password: password });
4032
+ if (this.app_s.LDAP_AUTH == 1)
4033
+ post_v = JSON.stringify({ username: username, password: password, ldap_auth: 1 });
4034
+ return this.http.post(this.url, post_v, {
4035
+ headers: this.headers
4036
+ }).pipe(operators.map((/**
4037
+ * @param {?} res
4038
+ * @return {?}
4039
+ */
4040
+ function (res) {
4041
+ // Handle errors, display if enabled
4042
+ /** @type {?} */
4043
+ var err;
4044
+ if (!res) {
4045
+ err = new Error('Empty server response');
4046
+ }
4047
+ else if (res.result_msg === 'KO') {
4048
+ err = new Error(res.msg);
4049
+ }
4050
+ else {
4051
+ if (res.result_data.length > 0) {
4052
+ localStorage.setItem(_this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
4053
+ }
4054
+ }
4055
+ if (err) {
4056
+ console.error(err);
4057
+ if (displayError) {
4058
+ _this.toastr.error(err.message);
4059
+ }
4060
+ throw new Error(err);
4061
+ }
4062
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4063
+ })), operators.catchError((/**
4064
+ * @param {?} err
4065
+ * @return {?}
4066
+ */
4067
+ function (err) {
4068
+ // In a real world app, we might use a remote logging infrastructure
4069
+ // We'd also dig deeper into the error to get a better message
4070
+ /** @type {?} */
4071
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4072
+ console.error(errMsg); // log to console instead
4073
+ throw err;
4074
+ })));
4075
+ };
4076
+ /**
4077
+ * @param {?} username
4078
+ * @param {?=} displayError
4079
+ * @return {?}
4080
+ */
4081
+ AuthenticationService.prototype.get_user_info = /**
4082
+ * @param {?} username
4083
+ * @param {?=} displayError
4084
+ * @return {?}
4085
+ */
4086
+ function (username, displayError) {
4087
+ var _this = this;
4088
+ if (displayError === void 0) { displayError = true; }
4089
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
4090
+ /** @type {?} */
4091
+ var post_v = JSON.stringify({ username_info: username });
4092
+ return this.http.post(this.url, post_v, {
4093
+ headers: this.headers
4094
+ }).pipe(operators.map((/**
4095
+ * @param {?} res
4096
+ * @return {?}
4097
+ */
4098
+ function (res) {
4099
+ // Handle errors, display if enabled
4100
+ /** @type {?} */
4101
+ var err;
4102
+ if (!res) {
4103
+ err = new Error('Empty server response');
4104
+ }
4105
+ else if (res.result_msg === 'KO') {
4106
+ err = new Error(res.msg);
4107
+ }
4108
+ if (err) {
4109
+ console.error(err);
4110
+ if (displayError) {
4111
+ _this.toastr.error(err.message);
4112
+ }
4113
+ throw new Error(err);
4114
+ }
4115
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4116
+ })), operators.catchError((/**
4117
+ * @param {?} err
4118
+ * @return {?}
4119
+ */
4120
+ function (err) {
4121
+ // In a real world app, we might use a remote logging infrastructure
4122
+ // We'd also dig deeper into the error to get a better message
4123
+ /** @type {?} */
4124
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4125
+ console.error(errMsg); // log to console instead
4126
+ throw err;
4127
+ })));
4128
+ };
4129
+ /**
4130
+ * @param {?} email
4131
+ * @param {?=} displayError
4132
+ * @return {?}
4133
+ */
4134
+ AuthenticationService.prototype.passrecovery = /**
4135
+ * @param {?} email
4136
+ * @param {?=} displayError
4137
+ * @return {?}
4138
+ */
4139
+ function (email, displayError) {
4140
+ var _this = this;
4141
+ if (displayError === void 0) { displayError = true; }
4142
+ /** @type {?} */
4143
+ var post_v = JSON.stringify({ email: email, websiteroot: this.app_s.COMPANY_SITE_ROOT, op: 'send_email' });
4144
+ return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
4145
+ headers: this.headers
4146
+ }).pipe(operators.map((/**
4147
+ * @param {?} res
4148
+ * @return {?}
4149
+ */
4150
+ function (res) {
4151
+ // Handle errors, display if enabled
4152
+ /** @type {?} */
4153
+ var err;
4154
+ if (!res) {
4155
+ err = new Error('Empty server response');
4156
+ }
4157
+ else if (res.result_msg === 'KO') {
4158
+ err = new Error(res.msg);
4159
+ }
4160
+ if (err) {
4161
+ console.error(err);
4162
+ if (displayError) {
4163
+ _this.toastr.error(err.message);
4164
+ }
4165
+ throw new Error(err);
4166
+ }
4167
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4168
+ })), operators.catchError((/**
4169
+ * @param {?} err
4170
+ * @return {?}
4171
+ */
4172
+ function (err) {
4173
+ // In a real world app, we might use a remote logging infrastructure
4174
+ // We'd also dig deeper into the error to get a better message
4175
+ /** @type {?} */
4176
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4177
+ console.error(errMsg); // log to console instead
4178
+ throw err;
4179
+ })));
4180
+ };
4181
+ /**
4182
+ * @param {?} res_rep
4183
+ * @param {?=} displayError
4184
+ * @return {?}
4185
+ */
4186
+ AuthenticationService.prototype.checktoken = /**
4187
+ * @param {?} res_rep
4188
+ * @param {?=} displayError
4189
+ * @return {?}
4190
+ */
4191
+ function (res_rep, displayError) {
4192
+ var _this = this;
4193
+ if (displayError === void 0) { displayError = true; }
4194
+ /** @type {?} */
4195
+ var post_v = JSON.stringify({ res_rep: res_rep, op: 'check_token' });
4196
+ return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
4197
+ headers: this.headers
4198
+ }).pipe(operators.map((/**
4199
+ * @param {?} res
4200
+ * @return {?}
4201
+ */
4202
+ function (res) {
4203
+ // Handle errors, display if enabled
4204
+ /** @type {?} */
4205
+ var err;
4206
+ if (!res) {
4207
+ err = new Error('Empty server response');
4208
+ }
4209
+ else if (res.result_msg === 'KO') {
4210
+ err = new Error(res.msg);
4211
+ }
4212
+ if (err) {
4213
+ console.error(err);
4214
+ if (displayError) {
4215
+ _this.toastr.error(err.message);
4216
+ }
4217
+ throw new Error(err);
4218
+ }
4219
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4220
+ })), operators.catchError((/**
4221
+ * @param {?} err
4222
+ * @return {?}
4223
+ */
4224
+ function (err) {
4225
+ // In a real world app, we might use a remote logging infrastructure
4226
+ // We'd also dig deeper into the error to get a better message
4227
+ /** @type {?} */
4228
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4229
+ console.error(errMsg); // log to console instead
4230
+ throw err;
4231
+ })));
4246
4232
  };
4247
- return FHUploadPanelComponent;
4248
- }());
4249
-
4250
- /**
4251
- * @fileoverview added by tsickle
4252
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4253
- */
4254
- var GridService = /** @class */ (function () {
4255
- function GridService(http, app_s, toastr) {
4256
- this.http = http;
4257
- this.app_s = app_s;
4258
- this.toastr = toastr;
4259
- this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT; // URL to web API
4260
- }
4261
- // URL to web API
4262
4233
  /**
4263
- * @param {?} queryp
4234
+ * @param {?} token
4235
+ * @param {?} password
4264
4236
  * @param {?=} displayError
4265
- * @param {?=} url_sec
4266
4237
  * @return {?}
4267
4238
  */
4268
- GridService.prototype.doQuery =
4269
- // URL to web API
4270
- /**
4271
- * @param {?} queryp
4239
+ AuthenticationService.prototype.change_password = /**
4240
+ * @param {?} token
4241
+ * @param {?} password
4272
4242
  * @param {?=} displayError
4273
- * @param {?=} url_sec
4274
4243
  * @return {?}
4275
4244
  */
4276
- function (queryp, displayError, url_sec) {
4245
+ function (token, password, displayError) {
4277
4246
  var _this = this;
4278
4247
  if (displayError === void 0) { displayError = true; }
4279
- if (url_sec === void 0) { url_sec = null; }
4280
- this.headers = new http.HttpHeaders({
4281
- 'Content-Type': 'application/json',
4282
- 'Authorization': 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
4283
- });
4284
- if (url_sec == null)
4285
- this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT;
4286
- else
4287
- this.url = url_sec;
4288
4248
  /** @type {?} */
4289
- var post_v = JSON.stringify(queryp);
4290
- return this.http.post(this.url, post_v, { headers: this.headers })
4291
- .pipe(operators.map((/**
4249
+ var post_v = JSON.stringify({ token: token, password: password, op: 'change_password' });
4250
+ return this.http.post(this.app_s.API_ENDPOINT + this.app_s.PASSRECOVERY_ENDPOINT, post_v, {
4251
+ headers: this.headers
4252
+ }).pipe(operators.map((/**
4292
4253
  * @param {?} res
4293
4254
  * @return {?}
4294
4255
  */
@@ -4323,494 +4284,689 @@
4323
4284
  throw err;
4324
4285
  })));
4325
4286
  };
4326
- GridService.decorators = [
4287
+ /**
4288
+ * @return {?}
4289
+ */
4290
+ AuthenticationService.prototype.checkCredentials_toLogin = /**
4291
+ * @return {?}
4292
+ */
4293
+ function () {
4294
+ if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
4295
+ this.goto_after = window.location.toString();
4296
+ if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
4297
+ if (this.router.url.indexOf('/rp/') == -1)
4298
+ this.router.navigate(['login']);
4299
+ return false;
4300
+ }
4301
+ return true;
4302
+ };
4303
+ /**
4304
+ * @return {?}
4305
+ */
4306
+ AuthenticationService.prototype.checkCredentials = /**
4307
+ * @return {?}
4308
+ */
4309
+ function () {
4310
+ if ('/login' != this.router.url && this.router.url.indexOf('/rp/') == -1)
4311
+ this.goto_after = window.location.toString();
4312
+ if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
4313
+ return false;
4314
+ }
4315
+ return true;
4316
+ };
4317
+ AuthenticationService.decorators = [
4327
4318
  { type: core.Injectable, args: [{
4328
4319
  providedIn: 'root',
4329
4320
  },] }
4330
4321
  ];
4331
4322
  /** @nocollapse */
4332
- GridService.ctorParameters = function () { return [
4323
+ AuthenticationService.ctorParameters = function () { return [
4324
+ { type: QueryService },
4325
+ { type: ngxToastr.ToastrService },
4333
4326
  { type: http.HttpClient },
4327
+ { type: router.Router },
4328
+ { type: router.ActivatedRoute },
4329
+ { type: FileService },
4334
4330
  { type: AppService },
4335
- { type: ngxToastr.ToastrService }
4331
+ { type: UtilityService }
4336
4332
  ]; };
4337
- /** @nocollapse */ GridService.ngInjectableDef = core.defineInjectable({ factory: function GridService_Factory() { return new GridService(core.inject(http.HttpClient), core.inject(AppService), core.inject(ngxToastr.ToastrService)); }, token: GridService, providedIn: "root" });
4338
- return GridService;
4333
+ /** @nocollapse */ AuthenticationService.ngInjectableDef = core.defineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(core.inject(QueryService), core.inject(ngxToastr.ToastrService), core.inject(http.HttpClient), core.inject(router.Router), core.inject(router.ActivatedRoute), core.inject(FileService), core.inject(AppService), core.inject(UtilityService)); }, token: AuthenticationService, providedIn: "root" });
4334
+ return AuthenticationService;
4339
4335
  }());
4340
4336
 
4341
4337
  /**
4342
4338
  * @fileoverview added by tsickle
4343
4339
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4344
4340
  */
4345
- var win_grid_help = /** @class */ (function () {
4346
- function win_grid_help(dialogRef, toastr, m_appService) {
4341
+ var WinAskTextBigComponent = /** @class */ (function () {
4342
+ function WinAskTextBigComponent(dialogRef, toastr) {
4347
4343
  this.dialogRef = dialogRef;
4348
4344
  this.toastr = toastr;
4349
- this.m_appService = m_appService;
4350
4345
  this.title = "";
4346
+ this.label = "";
4347
+ this.valore = "";
4348
+ this.readonly = false;
4349
+ this.show_annulla = true;
4350
+ this.show_ok = true;
4351
+ this.min_chars = 3;
4351
4352
  }
4352
4353
  /**
4353
4354
  * @return {?}
4354
4355
  */
4355
- win_grid_help.prototype.ngOnInit = /**
4356
+ WinAskTextBigComponent.prototype.ngOnInit = /**
4356
4357
  * @return {?}
4357
4358
  */
4358
4359
  function () {
4359
4360
  };
4360
- win_grid_help.decorators = [
4361
- { type: core.Component, args: [{
4362
- 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 ",
4363
- styles: ["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]
4364
- }] }
4365
- ];
4366
- /** @nocollapse */
4367
- win_grid_help.ctorParameters = function () { return [
4368
- { type: material.MatDialogRef },
4369
- { type: ngxToastr.ToastrService },
4370
- { type: AppService }
4371
- ]; };
4372
- return win_grid_help;
4373
- }());
4374
-
4375
- /**
4376
- * @fileoverview added by tsickle
4377
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4378
- */
4379
- var FHComboboxComponent = /** @class */ (function () {
4380
- function FHComboboxComponent(_dataService, _dataService_odbc) {
4381
- this._dataService = _dataService;
4382
- this._dataService_odbc = _dataService_odbc;
4383
- this.init_fill = true;
4384
- this.sql = "";
4385
- this.types = [];
4386
- this.values = [];
4387
- this.hidden = false;
4388
- this.label = "";
4389
- this.enabled = true;
4390
- this.required = false;
4391
- this.sel_label = "";
4392
- this.fillend = new core.EventEmitter();
4393
- this.selchange = new core.EventEmitter();
4394
- this.initend = new core.EventEmitter();
4395
- this.myData = [];
4396
- this.valDef = "-1";
4397
- this.selval = "-1";
4398
- this.errorMsg = "";
4399
- this.db_type = "1";
4400
- this.dis_value = '';
4401
- this.descri_val = "";
4402
- }
4403
4361
  /**
4404
- * @private
4405
4362
  * @return {?}
4406
4363
  */
4407
- FHComboboxComponent.prototype.update_dis = /**
4408
- * @private
4364
+ WinAskTextBigComponent.prototype.show = /**
4409
4365
  * @return {?}
4410
4366
  */
4411
4367
  function () {
4412
- this.dis_value = '';
4413
- try {
4414
- if (this.descri_val != null)
4415
- if (this.descri_val != "") {
4416
- this.dis_value = this.descri_val;
4417
- return;
4418
- }
4419
- if (this.valDef == null)
4420
- this.dis_value = '';
4421
- else
4422
- this.dis_value = this.valDef.split('-1').join('');
4423
- }
4424
- catch (e) {
4425
- console.log('errore split -> this.valDef ', this.valDef);
4426
- }
4427
4368
  };
4428
4369
  /**
4429
4370
  * @return {?}
4430
4371
  */
4431
- FHComboboxComponent.prototype.resetValue = /**
4372
+ WinAskTextBigComponent.prototype.hide = /**
4432
4373
  * @return {?}
4433
4374
  */
4434
4375
  function () {
4435
- this.selval = '-1';
4436
- this.valDef = '-1';
4437
- this.update_dis();
4376
+ this.dialogRef.close(null);
4438
4377
  };
4439
4378
  /**
4440
4379
  * @return {?}
4441
4380
  */
4442
- FHComboboxComponent.prototype.focus = /**
4381
+ WinAskTextBigComponent.prototype.do_check = /**
4443
4382
  * @return {?}
4444
4383
  */
4445
4384
  function () {
4446
- this.smtr.nativeElement.focus();
4385
+ if (this.valore.length < this.min_chars) {
4386
+ this.toastr.error('Il valore deve contenere almeno ' + this.min_chars + ' caratteri');
4387
+ return;
4388
+ }
4389
+ this.dialogRef.close(this.valore);
4390
+ };
4391
+ /**
4392
+ * @return {?}
4393
+ */
4394
+ WinAskTextBigComponent.prototype.chiudi = /**
4395
+ * @return {?}
4396
+ */
4397
+ function () {
4398
+ this.dialogRef.close(null);
4399
+ };
4400
+ WinAskTextBigComponent.decorators = [
4401
+ { type: core.Component, args: [{
4402
+ selector: 'app-win_ask_text',
4403
+ 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 "
4404
+ }] }
4405
+ ];
4406
+ /** @nocollapse */
4407
+ WinAskTextBigComponent.ctorParameters = function () { return [
4408
+ { type: material.MatDialogRef },
4409
+ { type: ngxToastr.ToastrService }
4410
+ ]; };
4411
+ WinAskTextBigComponent.propDecorators = {
4412
+ title: [{ type: core.Input }],
4413
+ label: [{ type: core.Input }],
4414
+ valore: [{ type: core.Input }],
4415
+ readonly: [{ type: core.Input }],
4416
+ show_annulla: [{ type: core.Input }],
4417
+ show_ok: [{ type: core.Input }]
4447
4418
  };
4419
+ return WinAskTextBigComponent;
4420
+ }());
4421
+
4422
+ /**
4423
+ * @fileoverview added by tsickle
4424
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4425
+ */
4426
+ var FHWinComboSelect = /** @class */ (function () {
4427
+ function FHWinComboSelect(dialogRef, toastr) {
4428
+ this.dialogRef = dialogRef;
4429
+ this.toastr = toastr;
4430
+ this.label = "";
4431
+ this.width = "100%";
4432
+ this.nota = false;
4433
+ this.nota_val = "";
4434
+ }
4448
4435
  /**
4436
+ * @param {?} lab
4437
+ * @param {?} myD
4438
+ * @param {?=} nota
4449
4439
  * @return {?}
4450
4440
  */
4451
- FHComboboxComponent.prototype.reset = /**
4441
+ FHWinComboSelect.prototype.set_selection = /**
4442
+ * @param {?} lab
4443
+ * @param {?} myD
4444
+ * @param {?=} nota
4452
4445
  * @return {?}
4453
4446
  */
4454
- function () {
4455
- this.selval = '-1';
4456
- this.valDef = '-1';
4457
- this.myData = new Array();
4458
- this.update_dis();
4447
+ function (lab, myD, nota) {
4448
+ if (nota === void 0) { nota = false; }
4449
+ this.nota = nota;
4450
+ this.label = lab;
4451
+ for (var i = 0; i < myD.length; i++)
4452
+ this.cmb_sel.add_option(myD[i]);
4459
4453
  };
4460
4454
  /**
4461
4455
  * @return {?}
4462
4456
  */
4463
- FHComboboxComponent.prototype.fillCombo = /**
4457
+ FHWinComboSelect.prototype.ok = /**
4464
4458
  * @return {?}
4465
4459
  */
4466
4460
  function () {
4467
- var _this = this;
4468
- // console.log(this.init_fill);
4469
- // if(!this.init_fill){this.init_fill=true;return;}
4470
- // console.log("fillcombo "+this.sql);
4471
- if (this.sql.indexOf('|') != -1 && this.sql.indexOf('$') != -1) {
4472
- this.set_options(this.sql);
4461
+ if (this.cmb_sel.getValue() == "-1") {
4462
+ this.toastr.error('Selezionare un valore');
4473
4463
  return;
4474
4464
  }
4475
- /** @type {?} */
4476
- var p = new QParam();
4477
- p.sql = this.sql;
4478
- p.types = this.types;
4479
- p.values = this.values;
4480
- // console.log(p);
4481
- if (this.db_type == "1")
4482
- this
4483
- ._dataService
4484
- .doQuery(p)
4485
- .subscribe((/**
4486
- * @param {?} data
4487
- * @return {?}
4488
- */
4489
- function (data) {
4490
- if (data != null)
4491
- if (data.result_msg == "OK") {
4492
- _this.resetD(data.result_data);
4493
- }
4494
- }), (/**
4495
- * @param {?} err
4496
- * @return {?}
4497
- */
4498
- function (err) {
4499
- _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
4500
- }));
4501
- if (this.db_type == "2")
4502
- this
4503
- ._dataService_odbc
4504
- .doQuery(p)
4505
- .subscribe((/**
4506
- * @param {?} data
4507
- * @return {?}
4508
- */
4509
- function (data) {
4510
- if (data != null)
4511
- if (data.result_msg == "OK") {
4512
- for (var i = 0; i < data.result_data.length; i++) {
4513
- if (data.result_data[i].VALORE != null)
4514
- data.result_data[i].valore = data.result_data[i].VALORE;
4515
- if (data.result_data[i].DESCRIZIONE_VALORE != null)
4516
- data.result_data[i].descrizione_valore = data.result_data[i].DESCRIZIONE_VALORE;
4517
- }
4518
- _this.resetD(data.result_data);
4519
- }
4520
- }), (/**
4521
- * @param {?} err
4522
- * @return {?}
4523
- */
4524
- function (err) {
4525
- _this.errorMsg = "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" + _this.sql + "]";
4526
- }));
4465
+ this.cmb_sel.getObj().nota = this.nota_val;
4466
+ this.dialogRef.close(this.cmb_sel.getObj());
4527
4467
  };
4528
4468
  /**
4529
- * @param {?} o
4530
4469
  * @return {?}
4531
4470
  */
4532
- FHComboboxComponent.prototype.add_option = /**
4533
- * @param {?} o
4471
+ FHWinComboSelect.prototype.ngOnInit = /**
4534
4472
  * @return {?}
4535
4473
  */
4536
- function (o) {
4537
- this.myData.push(o);
4474
+ function () {
4538
4475
  };
4539
- /**
4540
- * @param {?} o
4541
- * @return {?}
4542
- */
4543
- FHComboboxComponent.prototype.resetD = /**
4544
- * @param {?} o
4545
- * @return {?}
4546
- */
4547
- function (o) {
4548
- this.myData = o;
4549
- this.selval = '-1';
4550
- // console.log(this.smtr); console.log(this.smtr.nativeElement);
4551
- this.setByValue(this.valDef);
4552
- if (this.getValue() == "-1" && this.valDef != "-1")
4553
- this.setByDescri(this.valDef);
4554
- this.fillend.emit();
4476
+ FHWinComboSelect.decorators = [
4477
+ { type: core.Component, args: [{
4478
+ selector: 'fhwincomboselect',
4479
+ 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 "
4480
+ }] }
4481
+ ];
4482
+ /** @nocollapse */
4483
+ FHWinComboSelect.ctorParameters = function () { return [
4484
+ { type: material.MatDialogRef },
4485
+ { type: ngxToastr.ToastrService }
4486
+ ]; };
4487
+ FHWinComboSelect.propDecorators = {
4488
+ cmb_sel: [{ type: core.ViewChild, args: ['cmb_sel',] }]
4555
4489
  };
4490
+ return FHWinComboSelect;
4491
+ }());
4492
+
4493
+ /**
4494
+ * @fileoverview added by tsickle
4495
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4496
+ */
4497
+ var FHUploadPanelComponent = /** @class */ (function () {
4498
+ function FHUploadPanelComponent(_appservice, _dataService, toastr, dialog, auth_s, uti) {
4499
+ this._appservice = _appservice;
4500
+ this._dataService = _dataService;
4501
+ this.toastr = toastr;
4502
+ this.dialog = dialog;
4503
+ this.auth_s = auth_s;
4504
+ this.uti = uti;
4505
+ this.enabled = true;
4506
+ this.label = '';
4507
+ this.sovrascrivi_path = '';
4508
+ this.ruolo_supervisore = '[ZZZ_DIS_CC]';
4509
+ this.access_control = false;
4510
+ this.show_images = true;
4511
+ this.change = new core.EventEmitter();
4512
+ this.App = '';
4513
+ this.K = '';
4514
+ this.image_type = false;
4515
+ this.b_edit_loaded = false;
4516
+ this.b_False = false;
4517
+ this.b_mobile = false;
4518
+ this.b_ini = false;
4519
+ this.m_p_tipo = "";
4520
+ this.multi_list = false;
4521
+ this.m_programma_da_eseguire = "";
4522
+ }
4556
4523
  /**
4557
- * @param {?} desc_val
4524
+ * @param {?} ax
4558
4525
  * @return {?}
4559
4526
  */
4560
- FHComboboxComponent.prototype.setByDescri = /**
4561
- * @param {?} desc_val
4527
+ FHUploadPanelComponent.prototype.download_all = /**
4528
+ * @param {?} ax
4562
4529
  * @return {?}
4563
4530
  */
4564
- function (desc_val) {
4565
- // console.log("setByDescri "+desc_val);
4566
- this.valDef = desc_val;
4567
- this.selval = '-1';
4568
- if (desc_val == "")
4569
- return;
4570
- if (this.myData == null)
4571
- return;
4572
- if (this.myData.length == 0 || this.myData[0] == null)
4573
- return;
4574
- for (var j = 0; j < this.myData.length; j++)
4575
- if (this.myData[j].descrizione_valore == desc_val) {
4576
- this.selval = "" + this.myData[j].valore;
4577
- if (this.myData[j].descrizione_valore != null)
4578
- this.descri_val = this.myData[j].descrizione_valore;
4579
- this.update_dis();
4580
- return;
4581
- }
4582
- this.update_dis();
4531
+ function (ax) {
4532
+ if (ax.APP != null)
4533
+ ax.App = ax.APP;
4534
+ if (this.sovrascrivi_path == '') {
4535
+ window.open(this._appservice.COMPANY_SITE_ROOT + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
4536
+ }
4537
+ else {
4538
+ window.open(this.sovrascrivi_path + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
4539
+ }
4583
4540
  };
4584
4541
  /**
4585
- * @param {?} ind
4542
+ * @param {?} ax
4586
4543
  * @return {?}
4587
4544
  */
4588
- FHComboboxComponent.prototype.setByIndex = /**
4589
- * @param {?} ind
4545
+ FHUploadPanelComponent.prototype.edit_tipo = /**
4546
+ * @param {?} ax
4590
4547
  * @return {?}
4591
4548
  */
4592
- function (ind) {
4593
- this.valDef = "";
4594
- this.selval = '-1';
4595
- if (this.myData == null)
4596
- return;
4597
- if (this.myData.length == 0 || this.myData[0] == null)
4598
- return;
4599
- if (this.myData.length > ind) {
4600
- this.setByDescri(this.myData[ind].descrizione_valore);
4601
- }
4549
+ function (ax) {
4550
+ var _this = this;
4551
+ /** @type {?} */
4552
+ var p = new QParam();
4553
+ p.sql = this.m_p_tipo;
4554
+ p.types = [];
4555
+ p.values = [];
4556
+ this
4557
+ ._dataService
4558
+ .doQuery(p)
4559
+ .subscribe((/**
4560
+ * @param {?} data
4561
+ * @return {?}
4562
+ */
4563
+ function (data) {
4564
+ if (data != null)
4565
+ if (data.result_msg == "OK") {
4566
+ /** @type {?} */
4567
+ var dialogRef = _this
4568
+ .dialog
4569
+ .open(FHWinComboSelect);
4570
+ dialogRef.componentInstance.set_selection("Tipologia Allegato", data.result_data);
4571
+ dialogRef
4572
+ .afterClosed()
4573
+ .subscribe((/**
4574
+ * @param {?} result
4575
+ * @return {?}
4576
+ */
4577
+ function (result) {
4578
+ if (result != null) {
4579
+ /** @type {?} */
4580
+ var p_1 = new QParam();
4581
+ p_1.sql = "UPDATE_ALLEGATI_TIPO";
4582
+ p_1.types = ['int', 'string'];
4583
+ p_1.values = [ax.id, result.descrizione_valore];
4584
+ _this
4585
+ ._dataService
4586
+ .doQuery(p_1)
4587
+ .subscribe((/**
4588
+ * @param {?} data
4589
+ * @return {?}
4590
+ */
4591
+ function (data) {
4592
+ if (data != null)
4593
+ if (data.result_msg == "OK") {
4594
+ _this.ref_allegato();
4595
+ }
4596
+ }));
4597
+ }
4598
+ }));
4599
+ }
4600
+ }));
4602
4601
  };
4603
4602
  /**
4603
+ * @param {?} ax
4604
4604
  * @return {?}
4605
4605
  */
4606
- FHComboboxComponent.prototype.getObj = /**
4606
+ FHUploadPanelComponent.prototype.edit_descri = /**
4607
+ * @param {?} ax
4607
4608
  * @return {?}
4608
4609
  */
4609
- function () {
4610
- if (this.selval == null)
4611
- return null;
4612
- if (this.selval == "-1")
4613
- return null;
4614
- else
4615
- for (var j = 0; j < this.myData.length; j++)
4616
- if (this.myData[j].valore == this.selval) {
4617
- return this.myData[j];
4618
- }
4610
+ function (ax) {
4611
+ var _this = this;
4612
+ /** @type {?} */
4613
+ var dialogRef = this
4614
+ .dialog
4615
+ .open(WinAskTextBigComponent);
4616
+ dialogRef.componentInstance.label = "Descrizione Allegato";
4617
+ dialogRef.componentInstance.valore = ax.descrizione;
4618
+ dialogRef.componentInstance.min_chars = 0;
4619
+ dialogRef
4620
+ .afterClosed()
4621
+ .subscribe((/**
4622
+ * @param {?} result
4623
+ * @return {?}
4624
+ */
4625
+ function (result) {
4626
+ if (result != null) {
4627
+ /** @type {?} */
4628
+ var p = new QParam();
4629
+ p.sql = "UPDATE_ALLEGATI_DESCRIZIONE";
4630
+ p.types = ['int', 'string'];
4631
+ p.values = [ax.id, result];
4632
+ _this
4633
+ ._dataService
4634
+ .doQuery(p)
4635
+ .subscribe((/**
4636
+ * @param {?} data
4637
+ * @return {?}
4638
+ */
4639
+ function (data) {
4640
+ if (data != null)
4641
+ if (data.result_msg == "OK") {
4642
+ _this.ref_allegato();
4643
+ }
4644
+ }));
4645
+ }
4646
+ }));
4619
4647
  };
4620
4648
  /**
4621
- * @param {?} desc_val
4649
+ * @param {?} ax
4622
4650
  * @return {?}
4623
4651
  */
4624
- FHComboboxComponent.prototype.setByValue = /**
4625
- * @param {?} desc_val
4652
+ FHUploadPanelComponent.prototype.delete = /**
4653
+ * @param {?} ax
4626
4654
  * @return {?}
4627
4655
  */
4628
- function (desc_val) {
4629
- this.valDef = desc_val;
4630
- this.selval = '-1';
4631
- // console.log(this.myData);
4632
- if ("" + desc_val == "") {
4633
- // console.log('qqq1111');
4634
- return;
4635
- }
4636
- // console.log("qui");
4637
- if (this.myData == null)
4638
- return;
4639
- // console.log("qui1");
4640
- if (this.myData.length == 0 || this.myData[0] == null)
4641
- return;
4642
- //console.log("qui2");
4643
- for (var j = 0; j < this.myData.length; j++) {
4644
- //console.log(this.myData[j].valore +' '+ desc_val);
4645
- if (this.myData[j].valore == desc_val) {
4646
- this.selval = "" + this.myData[j].valore;
4647
- if (this.myData[j].descrizione_valore != null)
4648
- this.descri_val = this.myData[j].descrizione_valore;
4649
- this.update_dis();
4650
- return;
4656
+ function (ax) {
4657
+ var _this = this;
4658
+ localStorage.setItem(this._appservice.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
4659
+ localStorage.setItem(this._appservice.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
4660
+ /** @type {?} */
4661
+ var dialogRef = this
4662
+ .dialog
4663
+ .open(FHConfirmComponent);
4664
+ dialogRef
4665
+ .afterClosed()
4666
+ .subscribe((/**
4667
+ * @param {?} result
4668
+ * @return {?}
4669
+ */
4670
+ function (result) {
4671
+ if (result) {
4672
+ /** @type {?} */
4673
+ var p = new QParam();
4674
+ p.sql = "DELETE_ALLEGATO";
4675
+ p.types = ['int', 'string'];
4676
+ p.values = [ax.id, _this.auth_s.username];
4677
+ _this
4678
+ ._dataService
4679
+ .doQuery(p)
4680
+ .subscribe((/**
4681
+ * @param {?} data
4682
+ * @return {?}
4683
+ */
4684
+ function (data) {
4685
+ if (data != null)
4686
+ if (data.result_msg == "OK") {
4687
+ // this.arr_g = data.result_data;
4688
+ _this.ref_allegato();
4689
+ _this
4690
+ .toastr
4691
+ .info("INFO", "ALLEGATO ELIMINATO", {
4692
+ timeOut: 1000,
4693
+ progressBar: true
4694
+ });
4695
+ }
4696
+ }), (/**
4697
+ * @param {?} err
4698
+ * @return {?}
4699
+ */
4700
+ function (err) {
4701
+ }));
4651
4702
  }
4652
- }
4653
- this.update_dis();
4703
+ }));
4654
4704
  };
4655
4705
  /**
4656
4706
  * @return {?}
4657
4707
  */
4658
- FHComboboxComponent.prototype.getDescri = /**
4708
+ FHUploadPanelComponent.prototype.ngOnInit = /**
4659
4709
  * @return {?}
4660
4710
  */
4661
4711
  function () {
4662
- if (!this.enabled) {
4663
- if (this.selval == null)
4664
- return this.valDef;
4665
- if (this.selval == "-1")
4666
- return this.valDef;
4712
+ this.upc.single = false;
4713
+ this.b_mobile = this._appservice.getState().pageFullscreen;
4714
+ console.log('this.m_p_tipo ', this.m_p_tipo);
4715
+ this
4716
+ .upc
4717
+ .init(this.App, this.K, 'Descrizione Allegato', this.m_p_tipo, this.m_programma_da_eseguire);
4718
+ if (this.m_p_tipo.indexOf('SELECT_') > -1) {
4719
+ this.multi_list = true;
4667
4720
  }
4668
- if (this.selval == null)
4669
- return "-1";
4670
- if (this.selval == "-1")
4671
- return "-1";
4672
- else
4673
- for (var j = 0; j < this.myData.length; j++)
4674
- if (this.myData[j].valore == this.selval) {
4675
- return this.myData[j].descrizione_valore;
4676
- }
4721
+ this.ref_allegato();
4677
4722
  };
4678
4723
  /**
4724
+ * @param {?} p_app
4725
+ * @param {?} p_k
4726
+ * @param {?=} p_tipo
4727
+ * @param {?=} programma_da_eseguire
4679
4728
  * @return {?}
4680
4729
  */
4681
- FHComboboxComponent.prototype.getValue = /**
4730
+ FHUploadPanelComponent.prototype.init = /**
4731
+ * @param {?} p_app
4732
+ * @param {?} p_k
4733
+ * @param {?=} p_tipo
4734
+ * @param {?=} programma_da_eseguire
4682
4735
  * @return {?}
4683
4736
  */
4684
- function () {
4685
- // console.log(this.selval);
4686
- if (!this.enabled) {
4687
- if (this.selval == null)
4688
- return this.valDef;
4689
- if (this.selval == "-1")
4690
- return this.valDef;
4691
- }
4692
- if (this.selval == null)
4693
- return "-1";
4694
- if (this.selval == "")
4695
- return "-1";
4696
- else
4697
- return this.selval;
4737
+ function (p_app, p_k, p_tipo, programma_da_eseguire) {
4738
+ if (p_tipo === void 0) { p_tipo = ""; }
4739
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
4740
+ this.App = p_app;
4741
+ this.K = p_k;
4742
+ this.b_ini = true;
4743
+ this.b_edit_loaded = false;
4744
+ this.m_p_tipo = p_tipo;
4745
+ this.m_programma_da_eseguire = programma_da_eseguire;
4746
+ this.ngOnInit();
4698
4747
  };
4699
4748
  /**
4700
- * @param {?} campo
4701
4749
  * @return {?}
4702
4750
  */
4703
- FHComboboxComponent.prototype.getData = /**
4704
- * @param {?} campo
4751
+ FHUploadPanelComponent.prototype.ref_allegato = /**
4705
4752
  * @return {?}
4706
4753
  */
4707
- function (campo) {
4708
- for (var x in this.myData) {
4709
- if (this.myData[x]['valore'] == this.selval) {
4710
- return (this.myData[x][campo]);
4711
- }
4712
- else {
4713
- continue;
4714
- }
4715
- }
4754
+ function () {
4755
+ var _this = this;
4756
+ if (this.App == null)
4757
+ return;
4758
+ if (this.App == "")
4759
+ return;
4760
+ /** @type {?} */
4761
+ var p = new QParam();
4762
+ p.sql = "SELECT_ALLEGATO_INFO";
4763
+ p.types = ['string', 'string'];
4764
+ p.values = [this.App, this.K];
4765
+ this
4766
+ ._dataService
4767
+ .doQuery(p)
4768
+ .subscribe((/**
4769
+ * @param {?} data
4770
+ * @return {?}
4771
+ */
4772
+ function (data) {
4773
+ if (data != null)
4774
+ if (data.result_msg == "OK") {
4775
+ _this.arr_g = data.result_data;
4776
+ /** @type {?} */
4777
+ var iconf = "webinfo";
4778
+ for (var i = 0; i < _this.arr_g.length; i++) {
4779
+ if (_this.arr_g[i].APP != null)
4780
+ _this.arr_g[i].App = _this.arr_g[i].APP;
4781
+ if (_this.arr_g[i].descrizione != null)
4782
+ _this.arr_g[i].descrizione_vis = _this.arr_g[i].descrizione.split('\n').join('<br>');
4783
+ else
4784
+ _this.arr_g[i].descrizione_vis = '';
4785
+ /** @type {?} */
4786
+ var arrf = _this.arr_g[i].Filename.split('.');
4787
+ if (_this.sovrascrivi_path == '') {
4788
+ _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;
4789
+ _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;
4790
+ }
4791
+ else {
4792
+ _this.arr_g[i].url = _this.sovrascrivi_path + "/uploads/" + _this.arr_g[i].App + "/" + _this.arr_g[i].K + "/" + _this.arr_g[i].Filename;
4793
+ _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;
4794
+ }
4795
+ 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)
4796
+ iconf = arrf[arrf.length - 1].toLocaleLowerCase();
4797
+ _this.arr_g[i].icon = iconf + '.svg';
4798
+ _this.arr_g[i].can_delete = !_this.access_control || _this.arr_g[i].idp == _this._appservice.user || _this.uti.hasRole(_this.ruolo_supervisore);
4799
+ 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) {
4800
+ _this.arr_g[i].type = "IMG";
4801
+ _this.arr_g[i].image_original = [_this.arr_g[i].url];
4802
+ if (_this.arr_g[i].preview != null)
4803
+ if (_this.arr_g[i].preview == 1) {
4804
+ /** @type {?} */
4805
+ var pcs = _this.arr_g[i].url.split('.');
4806
+ /** @type {?} */
4807
+ var lastPc = pcs.pop();
4808
+ _this.arr_g[i].url = pcs.join('.') + '_preview.' + lastPc;
4809
+ }
4810
+ _this.image_type = true;
4811
+ _this.arr_g[i].image_thumbnail = [_this.arr_g[i].url];
4812
+ }
4813
+ else
4814
+ _this.arr_g[i].type = "O";
4815
+ }
4816
+ }
4817
+ }));
4818
+ };
4819
+ FHUploadPanelComponent.decorators = [
4820
+ { type: core.Component, args: [{
4821
+ 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 ",
4822
+ styles: ["\n\n\n\n "]
4823
+ }] }
4824
+ ];
4825
+ /** @nocollapse */
4826
+ FHUploadPanelComponent.ctorParameters = function () { return [
4827
+ { type: AppService },
4828
+ { type: QueryService },
4829
+ { type: ngxToastr.ToastrService },
4830
+ { type: material.MatDialog },
4831
+ { type: AuthenticationService },
4832
+ { type: UtilityService }
4833
+ ]; };
4834
+ FHUploadPanelComponent.propDecorators = {
4835
+ enabled: [{ type: core.Input }],
4836
+ label: [{ type: core.Input }],
4837
+ sovrascrivi_path: [{ type: core.Input }],
4838
+ ruolo_supervisore: [{ type: core.Input }],
4839
+ access_control: [{ type: core.Input }],
4840
+ show_images: [{ type: core.Input }],
4841
+ change: [{ type: core.Output }],
4842
+ upc: [{ type: core.ViewChild, args: ['upc',] }]
4716
4843
  };
4844
+ return FHUploadPanelComponent;
4845
+ }());
4846
+
4847
+ /**
4848
+ * @fileoverview added by tsickle
4849
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4850
+ */
4851
+ var GridService = /** @class */ (function () {
4852
+ function GridService(http, app_s, toastr) {
4853
+ this.http = http;
4854
+ this.app_s = app_s;
4855
+ this.toastr = toastr;
4856
+ this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT; // URL to web API
4857
+ }
4858
+ // URL to web API
4717
4859
  /**
4718
- * @param {?} s
4860
+ * @param {?} queryp
4861
+ * @param {?=} displayError
4862
+ * @param {?=} url_sec
4719
4863
  * @return {?}
4720
4864
  */
4721
- FHComboboxComponent.prototype.set_options = /**
4722
- * @param {?} s
4865
+ GridService.prototype.doQuery =
4866
+ // URL to web API
4867
+ /**
4868
+ * @param {?} queryp
4869
+ * @param {?=} displayError
4870
+ * @param {?=} url_sec
4723
4871
  * @return {?}
4724
4872
  */
4725
- function (s) {
4726
- this.myData = new Array();
4873
+ function (queryp, displayError, url_sec) {
4874
+ var _this = this;
4875
+ if (displayError === void 0) { displayError = true; }
4876
+ if (url_sec === void 0) { url_sec = null; }
4877
+ this.headers = new http.HttpHeaders({
4878
+ 'Content-Type': 'application/json',
4879
+ 'Authorization': 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
4880
+ });
4881
+ if (url_sec == null)
4882
+ this.url = this.app_s.API_ENDPOINT + this.app_s.GRID_ENDPOINT;
4883
+ else
4884
+ this.url = url_sec;
4727
4885
  /** @type {?} */
4728
- var a = s.split('$');
4729
- for (var i = 0; i < a.length; i++) {
4730
- /** @type {?} */
4731
- var o = new Object();
4886
+ var post_v = JSON.stringify(queryp);
4887
+ return this.http.post(this.url, post_v, { headers: this.headers })
4888
+ .pipe(operators.map((/**
4889
+ * @param {?} res
4890
+ * @return {?}
4891
+ */
4892
+ function (res) {
4893
+ // Handle errors, display if enabled
4732
4894
  /** @type {?} */
4733
- var av = a[i].split('|');
4734
- o.valore = av[1];
4735
- o.descrizione_valore = av[0];
4736
- this
4737
- .myData
4738
- .push(o);
4739
- }
4740
- this.setByValue(this.valDef);
4741
- if (this.getValue() == "-1")
4742
- this.setByDescri(this.valDef);
4743
- };
4744
- /**
4745
- * @return {?}
4746
- */
4747
- FHComboboxComponent.prototype.ngAfterViewInit = /**
4748
- * @return {?}
4749
- */
4750
- function () {
4751
- // console.log("ngAfterViewInit"); console.log(this.init_fill);
4752
- };
4753
- /**
4754
- * @return {?}
4755
- */
4756
- FHComboboxComponent.prototype.ngOnInit = /**
4757
- * @return {?}
4758
- */
4759
- function () {
4760
- if (this.init_fill == true) {
4761
- if (this.sql == '') {
4762
- //this.errorMsg="QUERY NON CONFIGURATA";
4763
- return;
4895
+ var err;
4896
+ if (!res) {
4897
+ err = new Error('Empty server response');
4764
4898
  }
4765
- this.fillCombo();
4766
- }
4767
- else {
4768
- this.errorMsg = "";
4769
- }
4770
- this
4771
- .initend
4772
- .emit();
4899
+ else if (res.result_msg === 'KO') {
4900
+ err = new Error(res.msg);
4901
+ }
4902
+ if (err) {
4903
+ console.error(err);
4904
+ if (displayError) {
4905
+ _this.toastr.error(err.message);
4906
+ }
4907
+ throw new Error(err);
4908
+ }
4909
+ return ((/** @type {?} */ ((/** @type {?} */ (res))))) || new QGResult();
4910
+ })), operators.catchError((/**
4911
+ * @param {?} err
4912
+ * @return {?}
4913
+ */
4914
+ function (err) {
4915
+ // In a real world app, we might use a remote logging infrastructure
4916
+ // We'd also dig deeper into the error to get a better message
4917
+ /** @type {?} */
4918
+ var errMsg = (err.message) ? err.message : err.status ? err.status + " - " + err.statusText : 'Server error';
4919
+ console.error(errMsg); // log to console instead
4920
+ throw err;
4921
+ })));
4773
4922
  };
4923
+ GridService.decorators = [
4924
+ { type: core.Injectable, args: [{
4925
+ providedIn: 'root',
4926
+ },] }
4927
+ ];
4928
+ /** @nocollapse */
4929
+ GridService.ctorParameters = function () { return [
4930
+ { type: http.HttpClient },
4931
+ { type: AppService },
4932
+ { type: ngxToastr.ToastrService }
4933
+ ]; };
4934
+ /** @nocollapse */ GridService.ngInjectableDef = core.defineInjectable({ factory: function GridService_Factory() { return new GridService(core.inject(http.HttpClient), core.inject(AppService), core.inject(ngxToastr.ToastrService)); }, token: GridService, providedIn: "root" });
4935
+ return GridService;
4936
+ }());
4937
+
4938
+ /**
4939
+ * @fileoverview added by tsickle
4940
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4941
+ */
4942
+ var win_grid_help = /** @class */ (function () {
4943
+ function win_grid_help(dialogRef, toastr, m_appService) {
4944
+ this.dialogRef = dialogRef;
4945
+ this.toastr = toastr;
4946
+ this.m_appService = m_appService;
4947
+ this.title = "";
4948
+ }
4774
4949
  /**
4775
4950
  * @return {?}
4776
4951
  */
4777
- FHComboboxComponent.prototype.sc = /**
4952
+ win_grid_help.prototype.ngOnInit = /**
4778
4953
  * @return {?}
4779
4954
  */
4780
4955
  function () {
4781
- this
4782
- .selchange
4783
- .emit({ event: this.getObj(), valore: this.getValue(), descrizione_valore: this.getDescri() });
4784
4956
  };
4785
- FHComboboxComponent.decorators = [
4957
+ win_grid_help.decorators = [
4786
4958
  { type: core.Component, args: [{
4787
- 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 ",
4788
- styles: ["\n\n "]
4959
+ 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 ",
4960
+ styles: ["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]
4789
4961
  }] }
4790
4962
  ];
4791
4963
  /** @nocollapse */
4792
- FHComboboxComponent.ctorParameters = function () { return [
4793
- { type: QueryService },
4794
- { type: OdbcService }
4964
+ win_grid_help.ctorParameters = function () { return [
4965
+ { type: material.MatDialogRef },
4966
+ { type: ngxToastr.ToastrService },
4967
+ { type: AppService }
4795
4968
  ]; };
4796
- FHComboboxComponent.propDecorators = {
4797
- init_fill: [{ type: core.Input }],
4798
- sql: [{ type: core.Input }],
4799
- types: [{ type: core.Input }],
4800
- values: [{ type: core.Input }],
4801
- hidden: [{ type: core.Input }],
4802
- label: [{ type: core.Input }],
4803
- enabled: [{ type: core.Input }],
4804
- required: [{ type: core.Input }],
4805
- sel_label: [{ type: core.Input }],
4806
- smtr: [{ type: core.ViewChild, args: ['cmb',] }],
4807
- fillend: [{ type: core.Output }],
4808
- selchange: [{ type: core.Output }],
4809
- initend: [{ type: core.Output }],
4810
- valDef: [{ type: core.Input }],
4811
- db_type: [{ type: core.Input }]
4812
- };
4813
- return FHComboboxComponent;
4969
+ return win_grid_help;
4814
4970
  }());
4815
4971
 
4816
4972
  /**
@@ -10481,77 +10637,6 @@
10481
10637
  return ComboBoxEditor;
10482
10638
  }());
10483
10639
 
10484
- /**
10485
- * @fileoverview added by tsickle
10486
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
10487
- */
10488
- var FHWinComboSelect = /** @class */ (function () {
10489
- function FHWinComboSelect(dialogRef, toastr) {
10490
- this.dialogRef = dialogRef;
10491
- this.toastr = toastr;
10492
- this.label = "";
10493
- this.width = "100%";
10494
- this.nota = false;
10495
- this.nota_val = "";
10496
- }
10497
- /**
10498
- * @param {?} lab
10499
- * @param {?} myD
10500
- * @param {?=} nota
10501
- * @return {?}
10502
- */
10503
- FHWinComboSelect.prototype.set_selection = /**
10504
- * @param {?} lab
10505
- * @param {?} myD
10506
- * @param {?=} nota
10507
- * @return {?}
10508
- */
10509
- function (lab, myD, nota) {
10510
- if (nota === void 0) { nota = false; }
10511
- this.nota = nota;
10512
- this.label = lab;
10513
- for (var i = 0; i < myD.length; i++)
10514
- this.cmb_sel.add_option(myD[i]);
10515
- };
10516
- /**
10517
- * @return {?}
10518
- */
10519
- FHWinComboSelect.prototype.ok = /**
10520
- * @return {?}
10521
- */
10522
- function () {
10523
- if (this.cmb_sel.getValue() == "-1") {
10524
- this.toastr.error('Selezionare un valore');
10525
- return;
10526
- }
10527
- this.cmb_sel.getObj().nota = this.nota_val;
10528
- this.dialogRef.close(this.cmb_sel.getObj());
10529
- };
10530
- /**
10531
- * @return {?}
10532
- */
10533
- FHWinComboSelect.prototype.ngOnInit = /**
10534
- * @return {?}
10535
- */
10536
- function () {
10537
- };
10538
- FHWinComboSelect.decorators = [
10539
- { type: core.Component, args: [{
10540
- selector: 'fhwincomboselect',
10541
- 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 "
10542
- }] }
10543
- ];
10544
- /** @nocollapse */
10545
- FHWinComboSelect.ctorParameters = function () { return [
10546
- { type: material.MatDialogRef },
10547
- { type: ngxToastr.ToastrService }
10548
- ]; };
10549
- FHWinComboSelect.propDecorators = {
10550
- cmb_sel: [{ type: core.ViewChild, args: ['cmb_sel',] }]
10551
- };
10552
- return FHWinComboSelect;
10553
- }());
10554
-
10555
10640
  /**
10556
10641
  * @fileoverview added by tsickle
10557
10642
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc