From b319f569d53cec5ced201b230acdbb485ff611cd Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Sun, 19 Sep 2021 10:46:21 +0200 Subject: [PATCH] Patch level : 12.0 1080 Files correlati : ve0.exe ve1.exe fp0.exe batbtpe.msk Commento : Meccanismo per attivare il tasto conferma dei documenti provvisori solo per utenti determinati. Interno: (CRPA) Bisogna definire nel paragrafo ve di studio.ini una variabile AHUsers = utente1|utente2|utente3.... non accessibile dall'interfaccia per ragioni di sicurezza. --- src/ve/ve0100.cpp | 38 +++++++++++++++++++++++++++----------- src/ve/ve0100.h | 1 + 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/ve/ve0100.cpp b/src/ve/ve0100.cpp index 1de962774..b893b128f 100755 --- a/src/ve/ve0100.cpp +++ b/src/ve/ve0100.cpp @@ -108,6 +108,15 @@ void TMotore_application::init_query_mode( TMask& m ) } } +bool TMotore_application::can_make_doc_def() +{ + static TToken_string __confirm_aut_users = "*"; + + if (__confirm_aut_users == "*") + __confirm_aut_users = ini_get_string(CONFIG_STUDIO, "VE", "AHUsers", ""); + return __confirm_aut_users.blank() || __confirm_aut_users.find(user()) >= 0; +} + void TMotore_application::init_insert_mode( TMask& m ) { TDocumento_mask& dm = (TDocumento_mask&)m; @@ -193,10 +202,16 @@ void TMotore_application::init_insert_mode( TMask& m ) dm.cli2mask(true); } - if (provv == 'P') + if (provv == 'P' && can_make_doc_def()) + { m.enable(DLG_CONFERMA); + m.show(DLG_CONFERMA); + } else + { m.disable(DLG_CONFERMA); + m.hide(DLG_CONFERMA); + } m.disable(DLG_PRINT); m.disable(DLG_PREVIEW); m.disable(DLG_EMAIL); @@ -226,22 +241,23 @@ void TMotore_application::init_modify_mode( TMask& m ) enable_menu_item(MENU_ITEM_ID(1)); if (provv == 'P') { - m.enable(DLG_CONFERMA); - m.disable(DLG_PRINT); + if (can_make_doc_def()) + { + m.enable(DLG_CONFERMA); + m.show(DLG_CONFERMA); + } m.disable(DLG_EMAIL); - m.disable(DLG_PREVIEW); - enable_menu_item(M_FILE_PRINT, false); - enable_menu_item(M_FILE_PREVIEW, false); } else { m.disable(DLG_CONFERMA); - m.enable(DLG_PRINT, enable_print); - m.enable(DLG_EMAIL, enable_print); - m.enable(DLG_PREVIEW, enable_print); - enable_menu_item(M_FILE_PRINT, enable_print); - enable_menu_item(M_FILE_PREVIEW, enable_print); + m.hide(DLG_CONFERMA); + m.enable(DLG_EMAIL, enable_print); } + m.enable(DLG_PRINT, enable_print); + m.enable(DLG_PREVIEW, enable_print); + enable_menu_item(M_FILE_PRINT, enable_print); + enable_menu_item(M_FILE_PREVIEW, enable_print); m.enable(DLG_ELABORA); m.disable(F_STATO); diff --git a/src/ve/ve0100.h b/src/ve/ve0100.h index bab5e9ad0..7e974e063 100755 --- a/src/ve/ve0100.h +++ b/src/ve/ve0100.h @@ -45,6 +45,7 @@ protected: virtual bool menu(MENU_TAG mt); virtual TMask* get_mask(int mode); virtual bool changing_mask(int mode); + bool can_make_doc_def(); virtual void init_query_mode(TMask& m); virtual void init_insert_mode(TMask& m); virtual void init_modify_mode(TMask& m);