From a25a076411a9f1baca60643337e9f61a4725ea2a Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 14 Mar 2003 14:54:28 +0000 Subject: [PATCH] Patch level : 2.0 424 Files correlati : ba1.exe Ricompilazione Demo : [ ] Commento : Vietate le conversioni di database quando il flag TestDatabse = N Obbligata l'installazione dell'intero modulo, quando il pacchetto base ha una versione piu' nuova ddi quello installato git-svn-id: svn://10.65.10.50/trunk@10911 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba1100.cpp | 30 +++++++++++-------- ba/ba1700.cpp | 80 +++++++++++++++++++++++++++++---------------------- 2 files changed, 63 insertions(+), 47 deletions(-) diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index bb084e66a..802bc5182 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -45,6 +45,8 @@ class TManutenzione_app : public TSkeleton_application TRec_sheet* _rec; FILE * _log; + bool _superprassi; + protected: virtual void main_loop(); virtual bool create () ; @@ -308,7 +310,15 @@ void TManutenzione_app::print() bool TManutenzione_app::create() // initvar e arrmask { _firm = get_firm(); + TString sw(argc()>2 ? argv(2) : ""); + + _superprassi = user() == ::dongle().administrator(); + if (_superprassi) + { + TConfig ini(CONFIG_INSTALL, "Main"); + _superprassi = ini.get_bool("TestDatabase"); + } if (argc() > 2 && sw == "-C") { @@ -349,10 +359,9 @@ bool TManutenzione_app::create() // initvar e arrmask #endif load_des(); - const bool superprassi = user() == ::dongle().administrator(); _mask = new TMask ("ba1100a"); - _browse = new TDir_sheet (TR("Manutenzione file di sistema"), superprassi ? 0xC : 0x8); - if (superprassi) + _browse = new TDir_sheet (TR("Manutenzione file di sistema"), _superprassi ? 0xC : 0x8); + if (_superprassi) { _browse->add_button(DLG_INSFILE, BR("~Inserisci", 9), K_F6); _browse->add_button(DLG_CONVERT, BR("~Converti", 9), K_F7); @@ -557,7 +566,6 @@ void TManutenzione_app::edit_riga (const TString& name) const TFilename n(name); TExternisamfile* f = new TExternisamfile(n); - const bool superprassi = user() == ::dongle().administrator(); _mask->set (FLD_NUM, ""); _mask->set (FLD_NOME, n); _mask->set (FLD_EOD, f->items()); @@ -569,7 +577,7 @@ void TManutenzione_app::edit_riga (const TString& name) _mask->reset (FLD_EXTEND); _mask->reset (F_TAB); _mask->disable(-1); - _mask->enable(DLG_RECORD, superprassi); + _mask->enable(DLG_RECORD, _superprassi); KEY tasto = _mask->run(); switch (tasto) @@ -599,11 +607,9 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga) TDir d; const int logicnum = int(riga_sel) + 1; - const bool superprassi = user() == ::dongle().administrator(); - - _mask->enable(DLG_PACK, superprassi); - _mask->enable(DLG_RECORD, superprassi); - _mask->enable(DLG_LOAD, superprassi); + _mask->enable(DLG_PACK, _superprassi); + _mask->enable(DLG_RECORD, _superprassi); + _mask->enable(DLG_LOAD, _superprassi); _mask->enable(DLG_DUMP); _mask->show(F_TAB, logicnum >= LF_TABGEN && logicnum <= LF_TAB); @@ -643,7 +649,7 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga) case K_F5: case K_F6: case K_F8: - if (!superprassi) + if (!_superprassi) { error_box(FR("Funzione non ammessa per l'utente %s"), (const char*)user()); break; @@ -1519,7 +1525,7 @@ void TManutenzione_app::main_loop() KEY key = _browse->run(); if (key != K_ENTER && key != K_QUIT && key != K_ESC && - user() != ::dongle().administrator()) + !_superprassi) { error_box(FR("Operazione non permessa all'utente %s"), (const char*)user()); key = 0; diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index 87e0317ae..dfcaeb9be 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -24,6 +24,7 @@ #define C_CURRPATCH 7 #define C_CURRDATAREL 8 #define C_ISPATCH 9 +#define C_BASEPATCH 10 #ifdef _DEMO_ const char* const http_default_path = "/aga/demo/zip/"; @@ -191,19 +192,20 @@ int TInstaller_mask::precheck_modules(bool only_newer) int patchlevel,modnumber; for (int r = 0; r < tot; r++) { - release = row(r).get(C_RELEASE); - patchlevel = row(r).get_int(C_PATCH); - currrelease = row(r).get(C_CURRRELEASE); - modnumber=get_module_number(row(r).get(C_CODE)); + TToken_string& rigar = row(r); + release = rigar.get(C_RELEASE); + patchlevel = rigar.get_int(C_PATCH); + currrelease = rigar.get(C_CURRRELEASE); + modnumber=get_module_number(rigar.get(C_CODE)); if (modnumber >= 0 && !release.blank() && ((release > currrelease) || (release == currrelease - && (only_newer ? patchlevel>row(r).get_int(C_CURRPATCH): patchlevel>=row(r).get_int(C_CURRPATCH)) )) + && (only_newer ? patchlevel>rigar.get_int(C_CURRPATCH): patchlevel>=rigar.get_int(C_CURRPATCH)) )) && main_app().has_module(modnumber,CHK_DONGLE) ) { // checca il modulo o la patch se ho installata la stessa versione - const bool chk = row(r).get_char(C_ISPATCH) != 'X' || release == row(r).get(C_CURRRELEASE); + const bool chk = rigar.get_char(C_ISPATCH) != 'X' || release == rigar.get(C_CURRRELEASE); check(r,chk ); } } @@ -369,29 +371,29 @@ bool TInstaller_mask::autoload() if (internet) { - http_dir(http_server, http_path, modules); - for (int i = modules.last(); i >= 0; i--) - { - TString& str = modules.row(i); - if (str.match("??0???A.INI") || str.match("??0???a.ini")) - { - TFilename remote = http_path; - remote << str; - - ininame = path; - ininame.add(str); - - if (!ininame.exist() && !http_get(http_server, remote, ininame)) - { - error_box(FR("Errore di trasferimento del file %s"), (const char*)remote); - modules.destroy(i); - } - str = ininame; - } - else + http_dir(http_server, http_path, modules); + for (int i = modules.last(); i >= 0; i--) + { + TString& str = modules.row(i); + if (str.match("??0???A.INI") || str.match("??0???a.ini")) + { + TFilename remote = http_path; + remote << str; + + ininame = path; + ininame.add(str); + + if (!ininame.exist() && !http_get(http_server, remote, ininame)) + { + error_box(FR("Errore di trasferimento del file %s"), (const char*)remote); + modules.destroy(i); + } + str = ininame; + } + else modules.destroy(i); - } - modules.pack(); + } + modules.pack(); } else { @@ -423,9 +425,12 @@ bool TInstaller_mask::autoload() && patchlevel > row.get_int(C_PATCH)) // ..e il patchlevel è superiore { TString16 patch; patch.format("%03d", patchlevel); //aggiunge zeri per avere 3 cifre sempre - row.add(patch, C_PATCH); // aggiorna il patchlevel mostrato per il modulo if (*row.get(C_ISPATCH)<=' ') // se era un modulo ... + { row.add("+", C_ISPATCH); // .....setta la presenza di patches + row.add(row.get(C_PATCH), C_BASEPATCH); // memorizza patch del modulo + } + row.add(patch, C_PATCH); // aggiorna il patchlevel mostrato per il modulo } } else @@ -1086,10 +1091,15 @@ void TInstaller_mask::install_selection() { if (has_patch) { - if (newver == oldver && newpatch >= oldpatch && - !noyes_box(FR("Si desidera reinstallare l'intero modulo '%s'?\nRispondendo NO verranno installate le sole patch"),(const char *)modulo)) + if (newver == oldver && newpatch >= oldpatch) { - is_patch = TRUE; + const int basepatch = row->get_int(C_BASEPATCH); + if (oldpatch >= basepatch) + is_patch = !noyes_box(FR("Si desidera reinstallare l'intero modulo '%s'?" + "\nRispondendo NO verranno installate le sole patch"), + (const char *)modulo); + else + is_patch = FALSE; // Quando la versione installata precede la patch base devo reinstallare il modulo! } } @@ -1178,15 +1188,15 @@ bool TInstaller_mask::on_key(KEY key) TInstaller_mask::TInstaller_mask() : TArray_sheet(0, 0, 0, 0, TR("Installazione"), - HR("@1|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento"), + HR("@1|Modulo@30|Cod.@3|Versione da\ninstallare@11|Liv.\nPatch@6|Data\nRilascio@10|Versione\nInstallata@10|Liv.\nPatch@6|Data\nInstallazione@13|Aggiornamento|Patch Base"), 0x18, 3) { _curr_mask = this; _installed = FALSE; _reboot_program= NONE; - add_string(F_PATH, 0, PR("Installa da "), 1, 1, 50); - add_string(F_CURPATH, 0, PR("Installa in "), 1, 2, 50, "D"); + add_string(F_PATH, 0, PR("Installa da "), 1, 1, 80, "", 60); + add_string(F_CURPATH, 0, PR("Installa in "), 1, 2, 80, "D", 60); add_button(F_UPDATE, BR("Rileggi", 9), '\0'); add_button(F_INSTALL, BR("Installa", 9), '\0'); // NON mettere 'I'