Patch level : 12.00 1284

Files correlati     : fp0.exe
Commento            :

Gli allegati esterni non venivano elaborati
This commit is contained in:
Alessandro Bonazzi 2023-09-29 00:32:18 +02:00
parent 749a907557
commit fb59d994d2

View File

@ -2984,9 +2984,11 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
}
}
}
TToken_string allegati(doc.get("COLL_GOLEM"), '\n');
bool load_allegati = true;
if (allegati.full())
TToken_string allegati(doc.get(DOC_COLL_GOLEM), '\n');
bool load_allegati = true;
if (allegati.full())
{
if (_def_fld.empty())
{
@ -3000,12 +3002,18 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
TFilename fname;
FOR_EACH_TOKEN(allegati, row)
{
const TToken_string entry(row);
TToken_string entry(row);
const bool external = entry.get_bool(2);
if (entry.get(0, fname))
{
TFilename file_path = golem_path;
file_path.add(fname.name());
TFilename file_path = fname;
if (!external)
{
file_path = golem_path;
file_path.add(fname.name());
}
if (file_path.exist())
{
if (!add_row_alleg(file_path, nprogr, paf2600f))
@ -3015,6 +3023,44 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
}
}
}
allegati = doc.get(DOC_CARTACEI);
if (allegati.full())
{
if (_def_fld.empty())
{
TString msgerr; msgerr << "Errore: il documento " << _bfatt << " ha degli allegati ma nella configurazione non stato impostato come trametterli\nCaricare il documento senza allegati?";
load_allegati = false;
if (!yesno_box(msgerr))
return false;
}
else
{
TFilename fname;
FOR_EACH_TOKEN(allegati, row)
{
TToken_string entry(row);
const bool external = entry.get_bool(2);
if (entry.get(0, fname))
{
TFilename file_path = fname;
if (!external)
{
file_path = golem_path;
file_path.add(fname.name());
}
if (file_path.exist())
{
if (!add_row_alleg(file_path, nprogr, paf2600f))
return false;
}
}
}
}
}
}
// Tabella di non invio XML