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;
|
TRec_sheet* _rec;
|
||||||
FILE * _log;
|
FILE * _log;
|
||||||
|
|
||||||
|
bool _superprassi;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
virtual bool create () ;
|
virtual bool create () ;
|
||||||
@ -308,7 +310,15 @@ void TManutenzione_app::print()
|
|||||||
bool TManutenzione_app::create() // initvar e arrmask
|
bool TManutenzione_app::create() // initvar e arrmask
|
||||||
{
|
{
|
||||||
_firm = get_firm();
|
_firm = get_firm();
|
||||||
|
|
||||||
TString sw(argc()>2 ? argv(2) : "");
|
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")
|
if (argc() > 2 && sw == "-C")
|
||||||
{
|
{
|
||||||
@ -349,10 +359,9 @@ bool TManutenzione_app::create() // initvar e arrmask
|
|||||||
#endif
|
#endif
|
||||||
load_des();
|
load_des();
|
||||||
|
|
||||||
const bool superprassi = user() == ::dongle().administrator();
|
|
||||||
_mask = new TMask ("ba1100a");
|
_mask = new TMask ("ba1100a");
|
||||||
_browse = new TDir_sheet (TR("Manutenzione file di sistema"), superprassi ? 0xC : 0x8);
|
_browse = new TDir_sheet (TR("Manutenzione file di sistema"), _superprassi ? 0xC : 0x8);
|
||||||
if (superprassi)
|
if (_superprassi)
|
||||||
{
|
{
|
||||||
_browse->add_button(DLG_INSFILE, BR("~Inserisci", 9), K_F6);
|
_browse->add_button(DLG_INSFILE, BR("~Inserisci", 9), K_F6);
|
||||||
_browse->add_button(DLG_CONVERT, BR("~Converti", 9), K_F7);
|
_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);
|
const TFilename n(name);
|
||||||
TExternisamfile* f = new TExternisamfile(n);
|
TExternisamfile* f = new TExternisamfile(n);
|
||||||
|
|
||||||
const bool superprassi = user() == ::dongle().administrator();
|
|
||||||
_mask->set (FLD_NUM, "");
|
_mask->set (FLD_NUM, "");
|
||||||
_mask->set (FLD_NOME, n);
|
_mask->set (FLD_NOME, n);
|
||||||
_mask->set (FLD_EOD, f->items());
|
_mask->set (FLD_EOD, f->items());
|
||||||
@ -569,7 +577,7 @@ void TManutenzione_app::edit_riga (const TString& name)
|
|||||||
_mask->reset (FLD_EXTEND);
|
_mask->reset (FLD_EXTEND);
|
||||||
_mask->reset (F_TAB);
|
_mask->reset (F_TAB);
|
||||||
_mask->disable(-1);
|
_mask->disable(-1);
|
||||||
_mask->enable(DLG_RECORD, superprassi);
|
_mask->enable(DLG_RECORD, _superprassi);
|
||||||
|
|
||||||
KEY tasto = _mask->run();
|
KEY tasto = _mask->run();
|
||||||
switch (tasto)
|
switch (tasto)
|
||||||
@ -599,11 +607,9 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
|||||||
TDir d;
|
TDir d;
|
||||||
const int logicnum = int(riga_sel) + 1;
|
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_PACK, superprassi);
|
_mask->enable(DLG_LOAD, _superprassi);
|
||||||
_mask->enable(DLG_RECORD, superprassi);
|
|
||||||
_mask->enable(DLG_LOAD, superprassi);
|
|
||||||
_mask->enable(DLG_DUMP);
|
_mask->enable(DLG_DUMP);
|
||||||
|
|
||||||
_mask->show(F_TAB, logicnum >= LF_TABGEN && logicnum <= LF_TAB);
|
_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_F5:
|
||||||
case K_F6:
|
case K_F6:
|
||||||
case K_F8:
|
case K_F8:
|
||||||
if (!superprassi)
|
if (!_superprassi)
|
||||||
{
|
{
|
||||||
error_box(FR("Funzione non ammessa per l'utente %s"), (const char*)user());
|
error_box(FR("Funzione non ammessa per l'utente %s"), (const char*)user());
|
||||||
break;
|
break;
|
||||||
@ -1519,7 +1525,7 @@ void TManutenzione_app::main_loop()
|
|||||||
KEY key = _browse->run();
|
KEY key = _browse->run();
|
||||||
|
|
||||||
if (key != K_ENTER && key != K_QUIT && key != K_ESC &&
|
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());
|
error_box(FR("Operazione non permessa all'utente %s"), (const char*)user());
|
||||||
key = 0;
|
key = 0;
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define C_CURRPATCH 7
|
#define C_CURRPATCH 7
|
||||||
#define C_CURRDATAREL 8
|
#define C_CURRDATAREL 8
|
||||||
#define C_ISPATCH 9
|
#define C_ISPATCH 9
|
||||||
|
#define C_BASEPATCH 10
|
||||||
|
|
||||||
#ifdef _DEMO_
|
#ifdef _DEMO_
|
||||||
const char* const http_default_path = "/aga/demo/zip/";
|
const char* const http_default_path = "/aga/demo/zip/";
|
||||||
@ -191,19 +192,20 @@ int TInstaller_mask::precheck_modules(bool only_newer)
|
|||||||
int patchlevel,modnumber;
|
int patchlevel,modnumber;
|
||||||
for (int r = 0; r < tot; r++)
|
for (int r = 0; r < tot; r++)
|
||||||
{
|
{
|
||||||
release = row(r).get(C_RELEASE);
|
TToken_string& rigar = row(r);
|
||||||
patchlevel = row(r).get_int(C_PATCH);
|
release = rigar.get(C_RELEASE);
|
||||||
currrelease = row(r).get(C_CURRRELEASE);
|
patchlevel = rigar.get_int(C_PATCH);
|
||||||
modnumber=get_module_number(row(r).get(C_CODE));
|
currrelease = rigar.get(C_CURRRELEASE);
|
||||||
|
modnumber=get_module_number(rigar.get(C_CODE));
|
||||||
if (modnumber >= 0 &&
|
if (modnumber >= 0 &&
|
||||||
!release.blank() &&
|
!release.blank() &&
|
||||||
((release > currrelease) ||
|
((release > currrelease) ||
|
||||||
(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) )
|
&& main_app().has_module(modnumber,CHK_DONGLE) )
|
||||||
{
|
{
|
||||||
// checca il modulo o la patch se ho installata la stessa versione
|
// 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 );
|
check(r,chk );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -369,29 +371,29 @@ bool TInstaller_mask::autoload()
|
|||||||
|
|
||||||
if (internet)
|
if (internet)
|
||||||
{
|
{
|
||||||
http_dir(http_server, http_path, modules);
|
http_dir(http_server, http_path, modules);
|
||||||
for (int i = modules.last(); i >= 0; i--)
|
for (int i = modules.last(); i >= 0; i--)
|
||||||
{
|
{
|
||||||
TString& str = modules.row(i);
|
TString& str = modules.row(i);
|
||||||
if (str.match("??0???A.INI") || str.match("??0???a.ini"))
|
if (str.match("??0???A.INI") || str.match("??0???a.ini"))
|
||||||
{
|
{
|
||||||
TFilename remote = http_path;
|
TFilename remote = http_path;
|
||||||
remote << str;
|
remote << str;
|
||||||
|
|
||||||
ininame = path;
|
ininame = path;
|
||||||
ininame.add(str);
|
ininame.add(str);
|
||||||
|
|
||||||
if (!ininame.exist() && !http_get(http_server, remote, ininame))
|
if (!ininame.exist() && !http_get(http_server, remote, ininame))
|
||||||
{
|
{
|
||||||
error_box(FR("Errore di trasferimento del file %s"), (const char*)remote);
|
error_box(FR("Errore di trasferimento del file %s"), (const char*)remote);
|
||||||
modules.destroy(i);
|
modules.destroy(i);
|
||||||
}
|
}
|
||||||
str = ininame;
|
str = ininame;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
modules.destroy(i);
|
modules.destroy(i);
|
||||||
}
|
}
|
||||||
modules.pack();
|
modules.pack();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -423,9 +425,12 @@ bool TInstaller_mask::autoload()
|
|||||||
&& patchlevel > row.get_int(C_PATCH)) // ..e il patchlevel è superiore
|
&& patchlevel > row.get_int(C_PATCH)) // ..e il patchlevel è superiore
|
||||||
{
|
{
|
||||||
TString16 patch; patch.format("%03d", patchlevel); //aggiunge zeri per avere 3 cifre sempre
|
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 ...
|
if (*row.get(C_ISPATCH)<=' ') // se era un modulo ...
|
||||||
|
{
|
||||||
row.add("+", C_ISPATCH); // .....setta la presenza di patches
|
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
|
else
|
||||||
@ -1086,10 +1091,15 @@ void TInstaller_mask::install_selection()
|
|||||||
{
|
{
|
||||||
if (has_patch)
|
if (has_patch)
|
||||||
{
|
{
|
||||||
if (newver == oldver && newpatch >= oldpatch &&
|
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))
|
|
||||||
{
|
{
|
||||||
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()
|
TInstaller_mask::TInstaller_mask()
|
||||||
: TArray_sheet(0, 0, 0, 0, TR("Installazione"),
|
: 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)
|
0x18, 3)
|
||||||
{
|
{
|
||||||
_curr_mask = this;
|
_curr_mask = this;
|
||||||
_installed = FALSE;
|
_installed = FALSE;
|
||||||
_reboot_program= NONE;
|
_reboot_program= NONE;
|
||||||
|
|
||||||
add_string(F_PATH, 0, PR("Installa da "), 1, 1, 50);
|
add_string(F_PATH, 0, PR("Installa da "), 1, 1, 80, "", 60);
|
||||||
add_string(F_CURPATH, 0, PR("Installa in "), 1, 2, 50, "D");
|
add_string(F_CURPATH, 0, PR("Installa in "), 1, 2, 80, "D", 60);
|
||||||
|
|
||||||
add_button(F_UPDATE, BR("Rileggi", 9), '\0');
|
add_button(F_UPDATE, BR("Rileggi", 9), '\0');
|
||||||
add_button(F_INSTALL, BR("Installa", 9), '\0'); // NON mettere 'I'
|
add_button(F_INSTALL, BR("Installa", 9), '\0'); // NON mettere 'I'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user