Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00

This commit is contained in:
smen 2021-10-19 09:39:33 +02:00
commit 8f719c36c5
4 changed files with 23 additions and 17 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1582,7 +1582,7 @@ void TImporta_Beestore::transaction_doc(TODBC_recordset & docs, const char * tab
TString codpk;
TArray transactions;
TArray art_transactions;
TTransaction t("");
TTransaction t("", LF_DOC);
TAssoc_array art_inserted;
bool nuovo = false;
bool elab = false;
@ -1711,7 +1711,7 @@ void TImporta_Beestore::transaction_doc(TODBC_recordset & docs, const char * tab
if (!art_inserted.is_key(codart) && cache().get(LF_ANAMAG, codart).empty())
{
TTransaction tart(TFilename().temp("art"));
TTransaction tart(TFilename().temp("art"), LF_ANAMAG);
art_inserted.add(codart, codart);
tart.set_action(TRANSACTION_INSERT);

View File

@ -370,9 +370,7 @@ bool TTransaction::set(
const char* rowkey = build_rowkey(table, row);
TAssoc_array * row_data = (TAssoc_array *)_rows.objptr(rowkey);
if (_executer.blank())
_executer = table;
if (row_data == nullptr)
if (row_data == nullptr)
_rows.add(rowkey, row_data = new TAssoc_array, true);
if (row_data != nullptr)
{
@ -492,7 +490,10 @@ bool TTransaction::read_ini()
int index = get_varkey_index(key);
TString name = get_varkey_name(key);
set(name, cnf.get(name, *para, index), index, table, row);
if (name == "Executer")
_executer = cnf.get(name, *para);
else
set(name, cnf.get(name, *para, index), index, table, row);
}
}
return true;
@ -537,6 +538,9 @@ bool TTransaction::read_xml()
int index = get_varkey_index(*str);
TString name = get_varkey_name(*str);
if (name == "Executer")
_executer = child_row->GetAttr(*str);
else
set(name, child_row->GetAttr(*str), index, logicnum, row);
}
}
@ -575,6 +579,7 @@ bool TTransaction::write_ini()
_head.get_keys(arr);
cnf.set("Version", "2.0");
cnf.set("Executer", _executer);
FOR_EACH_ARRAY_ROW(arr, r, str)
{
int index = get_varkey_index(*str);
@ -624,6 +629,7 @@ bool TTransaction::write_xml()
TXmlItem & child = xml.AddChild("Transaction");
_head.get_keys(arr);
child.AddEnclosedText("Version", "2.0");
child.AddEnclosedText("Executer", _executer);
FOR_EACH_ARRAY_ROW(arr, r, str)
child.AddEnclosedText(*str, *((TString *)_head.objptr(*str)));
_rows.get_keys(row_arr);
@ -740,9 +746,14 @@ void execute_transactions(TArray & transactions, TLog_report & log, bool interac
while (true)
{
int i = first;
TTransaction t = (TTransaction &)transactions[i];
TString table = t.executer();
TString table = ((TTransaction &)transactions[i]).executer();
int logicnum = atoi(table);
TFilename pref = ((TTransaction &)transactions[i]).name();
TString ext = ((TTransaction &)transactions[i]).ext();
pref.ext("");
while (isdigit(pref[pref.len() - 1]))
pref.rtrim(1);
while (processed[i])
i++;
@ -750,16 +761,12 @@ void execute_transactions(TArray & transactions, TLog_report & log, bool interac
break;
if (table.full())
{
TFilename pref = t.name();
pref.ext("");
while (isdigit(pref[pref.len() - 1]))
pref.rtrim(1);
int totalTransaction = 0;
while (i >= 0)
{
TTransaction &t = (TTransaction &)transactions[i];
TRACE("Salvataggio registrazione %d - %s = %s %s starts with %s", i , (const char*)t.executer(), (const char*)table, (const char*)t.name(), (const char*)pref);
if (t.executer() == table && t.name().starts_with(pref))
{
@ -773,7 +780,6 @@ void execute_transactions(TArray & transactions, TLog_report & log, bool interac
i++;
if (i > last)
break;
t = (TTransaction &)transactions[i];
}
TString app;
@ -784,7 +790,7 @@ void execute_transactions(TArray & transactions, TLog_report & log, bool interac
TFilename filemask(pref);
TString_array files;
filemask << "*" << "." << t.ext();
filemask << "*" << "." << ext;
app << (interactive ? " -i" : " -b") << filemask;
if (prog_msg.full())
app << " -m\"" << prog_msg << "\"";
@ -821,7 +827,7 @@ void execute_transactions(TArray & transactions, TLog_report & log, bool interac
{
TString msg(TR("Esecutore sconosciuto per le transazioni sul file "));
msg << (logicnum == 0) ? t.executer() : prefix().description(logicnum);
msg << (logicnum == 0) ? table : prefix().description(logicnum);
log.log(2, msg);
}
}