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
This commit is contained in:
parent
bf07ae13e0
commit
a25a076411
@ -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,8 +310,16 @@ 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")
|
||||
{
|
||||
update();
|
||||
@ -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;
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user