Patch level : 4.0 612
Files correlati : ba3.exe cg0.exe cg2.exe Ricompilazione Demo : [ ] Commento : Aggiunto supporto per savare le transazioni anche in una cartella git-svn-id: svn://10.65.10.50/trunk@13985 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9c1089e4d8
commit
baef024a0a
@ -2,6 +2,7 @@
|
|||||||
#include <golem.h>
|
#include <golem.h>
|
||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TRecipient
|
// TRecipient
|
||||||
@ -171,41 +172,63 @@ bool TPostman::dispatch_transaction(const TRectype& rec,
|
|||||||
bool ok = can_dispatch_transaction(rec);
|
bool ok = can_dispatch_transaction(rec);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TToken_string dest;
|
TToken_string dest;
|
||||||
for (int r = 0; r < _recipient.items(); r++)
|
TToken_string file_dest;
|
||||||
{
|
|
||||||
const TRecipient& a = recipient(r);
|
|
||||||
if (a.can_receive(rec))
|
|
||||||
dest.add(a.address());
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = dest.items() > 0;
|
for (int r = 0; r < _recipient.items(); r++)
|
||||||
if (ok)
|
{
|
||||||
{
|
const TRecipient& a = recipient(r);
|
||||||
TMail_message msg(dest.get(0));
|
if (a.can_receive(rec))
|
||||||
for (const char* r = dest.get(1); r; r = dest.get())
|
{
|
||||||
msg.add_copy_recipient(r);
|
const TFixed_string addr(a.address());
|
||||||
|
|
||||||
|
if (addr.find('@') >= 0)
|
||||||
|
dest.add(addr);
|
||||||
|
else
|
||||||
|
file_dest.add(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TString16 subject;
|
if (dest.items() > 0)
|
||||||
switch (rec.num())
|
{
|
||||||
{
|
TMail_message msg(dest.get(0));
|
||||||
case LF_TAB:
|
for (const char* r = dest.get(1); r; r = dest.get())
|
||||||
case LF_TABCOM:
|
msg.add_copy_recipient(r);
|
||||||
case LF_TABGEN:
|
|
||||||
subject << rec.get("COD"); break;
|
|
||||||
default:
|
|
||||||
subject << rec.num();
|
|
||||||
}
|
|
||||||
msg.set_subject(subject);
|
|
||||||
|
|
||||||
TScanner trans(name);
|
TString16 subject;
|
||||||
while (trans.good())
|
switch (rec.num())
|
||||||
{
|
{
|
||||||
TString& line = trans.line();
|
case LF_TAB:
|
||||||
msg.add_line(line);
|
case LF_TABCOM:
|
||||||
}
|
case LF_TABGEN:
|
||||||
ok = msg.send(TRUE);
|
subject << rec.get("COD"); break;
|
||||||
}
|
default:
|
||||||
|
subject << rec.num();
|
||||||
|
}
|
||||||
|
msg.set_subject(subject);
|
||||||
|
|
||||||
|
TScanner trans(name);
|
||||||
|
while (trans.good())
|
||||||
|
{
|
||||||
|
TString& line = trans.line();
|
||||||
|
msg.add_line(line);
|
||||||
|
}
|
||||||
|
ok = msg.send(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_dest.items() > 0)
|
||||||
|
{
|
||||||
|
for (const char* r = file_dest.get(0); r; r = file_dest.get())
|
||||||
|
if (fexist(r))
|
||||||
|
{
|
||||||
|
TFilename output(r);
|
||||||
|
|
||||||
|
output.add(name.name());
|
||||||
|
ok &= fcopy(name, output);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
error_box("Non esiste la cartella %s", r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user