Patch level :4.0 411
Files correlati : Ricompilazione Demo : [ ] Commento :riportata modifica dalla 2.1 per la generazione dei files dai nuovi tracciati git-svn-id: svn://10.65.10.50/trunk@13980 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
534b7c8bb5
commit
d4a9c624d9
113
ba/ba1100.cpp
113
ba/ba1100.cpp
@ -53,7 +53,7 @@ protected:
|
||||
void edit_riga(long, TToken_string&);
|
||||
void edit_riga(const TString&);
|
||||
void delete_riga();
|
||||
virtual bool extended_firm() const { return TRUE; }
|
||||
virtual bool extended_firm() const { return true; }
|
||||
|
||||
bool recover(TSystemisamfile& f, int err);
|
||||
void update();
|
||||
@ -100,7 +100,7 @@ HIDDEN bool browse_file_handler(TMask_field& f, KEY k)
|
||||
f.set_focus();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
TManutenzione_app::TManutenzione_app() : _browse(NULL), _mask(NULL), _firm(0), _level(0), _rec(NULL)
|
||||
@ -274,7 +274,7 @@ void TManutenzione_app::print()
|
||||
d.get(LF_DIR);
|
||||
int items = (int)d.eod();
|
||||
TProgind *pi;
|
||||
pi = new TProgind(items, TR("Stampa tracciati record archivi"), TRUE, TRUE);
|
||||
pi = new TProgind(items, TR("Stampa tracciati record archivi"), true, true);
|
||||
|
||||
pi->setstatus(2);
|
||||
|
||||
@ -296,7 +296,7 @@ void TManutenzione_app::print()
|
||||
TString_array list;
|
||||
items = list_files("recdesc/d???.des", list);
|
||||
|
||||
pi = new TProgind(items,TR("Stampa descrizione tabelle"), TRUE, TRUE);
|
||||
pi = new TProgind(items,TR("Stampa descrizione tabelle"), true, true);
|
||||
|
||||
TString16 tab;
|
||||
for (i = 0; !pi->iscancelled() && i < items; i++)
|
||||
@ -333,39 +333,39 @@ bool TManutenzione_app::create() // initvar e arrmask
|
||||
if (argc() > 2 && sw == "-C")
|
||||
{
|
||||
update();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sw == "-D")
|
||||
{
|
||||
const int c = argc();
|
||||
bool des_too = TRUE; // Anche le descrizioni
|
||||
bool des_too = true; // Anche le descrizioni
|
||||
long modules = -1; // Tutti i moduli
|
||||
if (c < 4)
|
||||
{
|
||||
error_box("Usage: BA1 -0 -D <directory> [0|1] [<module number>]");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
TFilename dir(argv(3));
|
||||
if (!fexist(dir))
|
||||
{
|
||||
error_box(FR("Non esiste il direttorio %s"), (const char*)dir);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (c == 5)
|
||||
des_too = atoi(argv(4)) ? TRUE : FALSE;
|
||||
des_too = atoi(argv(4)) ? true : false;
|
||||
if (c == 6)
|
||||
modules = atol(argv(5));
|
||||
prefix().set("");
|
||||
load_des();
|
||||
dump_trc(dir,des_too,modules);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#ifndef _DEMO_
|
||||
else
|
||||
if (!set_firm())
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
load_des();
|
||||
|
||||
@ -527,7 +527,7 @@ void TManutenzione_app::dump_trc(const char * dir, const bool des_too, const lon
|
||||
|
||||
TString s(TR("Scarico dei tracciati standard in "));
|
||||
s << dir;
|
||||
TProgind p(items ? items : 1, s, FALSE, TRUE);
|
||||
TProgind p(items ? items : 1, s, false, true);
|
||||
p.setstatus(1);
|
||||
for (int i=2;i<=items;i++) //Salta il primo (dir.gen)
|
||||
{
|
||||
@ -734,10 +734,10 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
||||
{
|
||||
TToken_string filter;
|
||||
filter.add("COD"); filter.add(tabella);
|
||||
f.dump(nout, keyno, fs, fd, rs, TRUE, withdel, filter);
|
||||
f.dump(nout, keyno, fs, fd, rs, true, withdel, filter);
|
||||
}
|
||||
else
|
||||
f.dump(nout, keyno, fs, fd, rs, TRUE, withdel);
|
||||
f.dump(nout, keyno, fs, fd, rs, true, withdel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -871,7 +871,7 @@ void TManutenzione_app::update_dir()
|
||||
prompt << atol(pref) <<".";
|
||||
}
|
||||
|
||||
TProgind p(update_items ? update_items : 1, prompt, FALSE, TRUE);
|
||||
TProgind p(update_items ? update_items : 1, prompt, false, true);
|
||||
p.setstatus(1);
|
||||
|
||||
int i;
|
||||
@ -879,20 +879,16 @@ void TManutenzione_app::update_dir()
|
||||
for (i = 2; i <= update_items; i++)
|
||||
{
|
||||
p.addstatus(1);
|
||||
// prefix().set("");
|
||||
|
||||
const TDir & ds = (const TDir &) _dirs[i];
|
||||
const bool is_firm = ds.is_firm();
|
||||
const bool to_create = (is_com ? ds.is_com() : ds.is_firm());
|
||||
|
||||
|
||||
// TString s(ds.name());
|
||||
TFilename fd(ds.filename());
|
||||
|
||||
bool towrite = FALSE;
|
||||
bool towrite = false;
|
||||
|
||||
const long flags = ds.flags();
|
||||
// word len = ds.len();
|
||||
// prefix().set(pref);
|
||||
d.get(i, _nolock, _nordir, _sysdirop);
|
||||
const bool old_is_firm = d.is_firm();
|
||||
d.get(i);
|
||||
@ -948,7 +944,7 @@ void TManutenzione_app::update_dir()
|
||||
if (flags < 10000L && size > 0L && d.len() > 0)
|
||||
{
|
||||
TSystemisamfile b(i);
|
||||
int err = b.is_valid(TRUE);
|
||||
int err = b.is_valid(true);
|
||||
if (err == _istrcerr && d.eod() == 0 &&
|
||||
yesno_box(FR("Il tracciato record del file %d e' incoerente:\nSi desidera eliminare il file vuoto %s?"), i, d.filename()))
|
||||
{
|
||||
@ -995,10 +991,10 @@ void TManutenzione_app::update_dir()
|
||||
}
|
||||
d.get(i, _nolock, _nordir, _sysdirop);
|
||||
|
||||
bool cmn_file = FALSE;
|
||||
bool cmn_file = false;
|
||||
bool valid_file = moveable_file(i);
|
||||
if (!is_com && valid_file && d.is_com())
|
||||
cmn_file = TRUE; // Salta in questo caso:
|
||||
cmn_file = true; // Salta in questo caso:
|
||||
// sto aggiornando le ditte,
|
||||
// il file in questione e' uno di quelli che possono essere comuni
|
||||
// il file e' in comune
|
||||
@ -1010,7 +1006,7 @@ void TManutenzione_app::update_dir()
|
||||
{
|
||||
if (flags < 10000L && flags > -1L && fexist(fs) && (fd != fs))
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
TFilename path(fd.path());
|
||||
|
||||
path.rtrim(1);
|
||||
@ -1037,7 +1033,7 @@ void TManutenzione_app::update_dir()
|
||||
fdi.ext(fsi.ext());
|
||||
td.add(fdi);
|
||||
if (!fcopy(fsi, fdi))
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
@ -1075,18 +1071,18 @@ void TManutenzione_app::update_dir()
|
||||
}
|
||||
}
|
||||
else
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
if (ok)
|
||||
{
|
||||
d.set(ds.name(), d.eox(), 0L, ds.des(), d.expr());
|
||||
towrite = TRUE;
|
||||
towrite = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fexist(fs) && !valid_file) // Controlla eventali nomi di files non validi (ed es. %.dbf ecc.)
|
||||
{
|
||||
d.set(ds.name(), d.eox(), 0L, ds.des(), d.expr());
|
||||
towrite = TRUE;
|
||||
towrite = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1103,7 +1099,7 @@ void TManutenzione_app::update_dir()
|
||||
TString name(d.name());
|
||||
name[0] = '%';
|
||||
d.set_name(name);
|
||||
towrite = TRUE;
|
||||
towrite = true;
|
||||
}
|
||||
if (towrite)
|
||||
d.put(i, _nordir, _sysdirop);
|
||||
@ -1116,11 +1112,12 @@ void TManutenzione_app::update_dir()
|
||||
TDir d1((TDir &) _dirs[i]);
|
||||
|
||||
d1.set_len(0);
|
||||
d1.eox() = 0;
|
||||
d1.eox() = 0L;
|
||||
d1.eod() = 0L;
|
||||
d1.flags() = 0L;
|
||||
d1.put(i, _nordir, _sysdirop);
|
||||
}
|
||||
// prefix().set(pref);
|
||||
|
||||
d.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
d.eod() = orig_items;
|
||||
if (d.eox() < d.eod())
|
||||
@ -1152,7 +1149,7 @@ void TManutenzione_app::convert_dir()
|
||||
s << atol (pref) << ".";
|
||||
}
|
||||
|
||||
TProgind p(update_items ? update_items : 1, s, FALSE, TRUE);
|
||||
TProgind p(update_items ? update_items : 1, s, false, true);
|
||||
p.setstatus(1);
|
||||
|
||||
for (int i = 2; i <= update_items; i++)
|
||||
@ -1169,8 +1166,9 @@ void TManutenzione_app::convert_dir()
|
||||
{
|
||||
TSystemisamfile b(i);
|
||||
const int module = abs((int)ds.flags());
|
||||
int err = b.is_valid(TRUE);
|
||||
if (err == -60 || err == -64) err=NOERR; // verif.
|
||||
int err = b.is_valid(true);
|
||||
if (err == -60 || err == -64)
|
||||
err=NOERR; // verif.
|
||||
d.get(i, _nolock, _nordir, _sysdirop);
|
||||
if (i > 2 && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm())))
|
||||
{
|
||||
@ -1187,32 +1185,32 @@ void TManutenzione_app::convert_dir()
|
||||
else
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} //if (i > 2 && err != NOERR &&...
|
||||
|
||||
bool to_create = (is_com ? d.is_com() : d.is_firm());
|
||||
|
||||
// I files LF_PCON, LF_CAUS, LF_RCAUS, LF_CLIFO, LF_CFVEN, LF_INDSPED
|
||||
// vanno creati comunque nel direttorio COM, vuoti, (se non esistono gia').
|
||||
if (is_com && !to_create)
|
||||
if (moveable_file(i))
|
||||
to_create = TRUE;
|
||||
if (is_com && !to_create && moveable_file(i))
|
||||
to_create = true;
|
||||
|
||||
if (to_create && has_module(module, CHK_DONGLE))
|
||||
{
|
||||
d.get(i);
|
||||
const TFilename s(d.filename());
|
||||
if (!s.exist() && d.len() > 0)
|
||||
TDir df; df.get(i);
|
||||
const TFilename s(df.filename());
|
||||
|
||||
//crea il nuovo file in base al tracciato record nuovo!
|
||||
if (!s.exist() && ds.len() > 0)
|
||||
{
|
||||
TSystemisamfile f(i);
|
||||
set_autoload_new_files(FALSE);
|
||||
set_autoload_new_files(false);
|
||||
f.build(0L,rs);
|
||||
set_autoload_new_files(TRUE);
|
||||
set_autoload_new_files(true);
|
||||
// Anche se il file non esisteva, prosegue, perche' possono esserci conversioni
|
||||
// specificate in FCONV.INI
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TSystemisamfile f(i);
|
||||
|
||||
f.update(rs, false);
|
||||
@ -1228,8 +1226,8 @@ void TManutenzione_app::convert_dir()
|
||||
}
|
||||
}
|
||||
stop_run();
|
||||
}
|
||||
}
|
||||
} //if(f.status()...
|
||||
} //if (flags >= 0L && < 10000L...
|
||||
else // altrimenti se i flags sono oltre i fatidici 10000...
|
||||
{
|
||||
TTrec r(rs);
|
||||
@ -1238,8 +1236,9 @@ void TManutenzione_app::convert_dir()
|
||||
d.set_len(r.len());
|
||||
d.put(i, _nordir, _sysdirop);
|
||||
r.put(i);
|
||||
}
|
||||
}
|
||||
} //else di if(flags>=...
|
||||
|
||||
} //if (ds.len() > 0... (la dimensione del tracciato e' > 0)
|
||||
else // altrimenti se la dimensione del tracciato e' zero...
|
||||
{
|
||||
TTrec r(rs);
|
||||
@ -1249,8 +1248,8 @@ void TManutenzione_app::convert_dir()
|
||||
d.set_len(r.len());
|
||||
d.put(i, _nordir, _sysdirop);
|
||||
r.put(i);
|
||||
}
|
||||
}
|
||||
} //else di if(ds.len()>0...
|
||||
} //for (int i = 2; i <= update_items...
|
||||
|
||||
d.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
d.flags() = _level;
|
||||
@ -1345,7 +1344,7 @@ void TManutenzione_app::load_des(const int maxfdir)
|
||||
if (prefix().is_com()) s << TR("Caricamento descrizioni archivi comuni");
|
||||
else s << TR("Caricamento descrizioni archivi della ditta ") << atol (pref);
|
||||
|
||||
TProgind p(items ? items : 1, s, FALSE, TRUE);
|
||||
TProgind p(items ? items : 1, s, false, true);
|
||||
|
||||
p.setstatus(1);
|
||||
for (int i = 2; i <= items; i++)
|
||||
@ -1393,7 +1392,7 @@ void TManutenzione_app::load_des(const int maxfdir)
|
||||
|
||||
void TManutenzione_app::update()
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
|
||||
TIsamfile utenti(LF_USER);
|
||||
utenti.open(_excllock);
|
||||
@ -1467,7 +1466,7 @@ void TManutenzione_app::update()
|
||||
|
||||
s = TR("Conversione archivi ditte.");
|
||||
|
||||
TProgind p(ditte.items() ? ditte.items() : 1, s, FALSE, TRUE);
|
||||
TProgind p(ditte.items() ? ditte.items() : 1, s, false, true);
|
||||
|
||||
p.setstatus(1);
|
||||
TString mxs;
|
||||
@ -1503,7 +1502,7 @@ void TManutenzione_app::update()
|
||||
else prefix().set(pref);
|
||||
load_des();
|
||||
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
while (!ok)
|
||||
{
|
||||
utenti.open(_excllock);
|
||||
@ -1526,7 +1525,7 @@ void TManutenzione_app::main_loop()
|
||||
{
|
||||
TToken_string riga;
|
||||
long riga_selezionata;
|
||||
bool done = FALSE;
|
||||
bool done = false;
|
||||
|
||||
_browse->rebuild();
|
||||
|
||||
@ -1563,7 +1562,7 @@ void TManutenzione_app::main_loop()
|
||||
case K_DEL: delete_riga(); break;
|
||||
|
||||
case K_QUIT:
|
||||
case K_ESC: done = TRUE; close_history(); break;
|
||||
case K_ESC: done = true; close_history(); break;
|
||||
|
||||
case K_F7:
|
||||
update(); break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user