Patch level : 12.0 1122
Files correlati : ve5.exe Commento : Modificiato programma Invio\Ricezione documenti perchè non scriva più sulla radice del disco rigido
This commit is contained in:
parent
f53cb0d39c
commit
2345cd9169
@ -264,7 +264,7 @@ bool TArchive::fsplit_zip(
|
||||
const TFilename archive(filename);
|
||||
|
||||
unsigned long size = 0;
|
||||
TFilename path; path << floppy << ':';
|
||||
TFilename path; path << floppy << ":";
|
||||
|
||||
while (size <= 0)
|
||||
{
|
||||
@ -587,33 +587,33 @@ bool TArchive::unzip(int mode, long firm, char floppy, bool temp)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TArchive::backup(const char* dir, char floppy, const char* desc, bool)
|
||||
bool TArchive::backup(const char* dir, char floppy, const char* desc)
|
||||
{
|
||||
return zip(dir, floppy, desc);
|
||||
}
|
||||
|
||||
bool TArchive::backup(const char* dir, const char* dirdest, const char* desc, bool) const
|
||||
bool TArchive::backup(const char* dir, const char* dirdest, const char* desc) const
|
||||
{
|
||||
TFilename work; work << dirdest; work.add(TFilename(dir).name()); work.ext("zip");
|
||||
return zip(dir, work);
|
||||
}
|
||||
|
||||
bool TArchive::backup(int mode, long firm, char floppy, const char* desc, bool)
|
||||
bool TArchive::backup(int mode, long firm, char floppy, const char* desc)
|
||||
{
|
||||
return zip(mode, firm, floppy, desc);
|
||||
}
|
||||
|
||||
bool TArchive::restore(const char* dir, char floppy, bool tmp, bool)
|
||||
bool TArchive::restore(const char* dir, char floppy, bool tmp)
|
||||
{
|
||||
return unzip(dir, floppy, tmp);
|
||||
}
|
||||
bool TArchive::restore(const char* dir, const char* fromdir, bool tmp, bool)
|
||||
bool TArchive::restore(const char* dir, const char* fromdir, bool tmp)
|
||||
{
|
||||
|
||||
return unzip(dir, fromdir, tmp);
|
||||
}
|
||||
|
||||
bool TArchive::restore(int mode, long firm, char floppy, bool tmp, bool)
|
||||
bool TArchive::restore(int mode, long firm, char floppy, bool tmp)
|
||||
{
|
||||
return unzip(mode, firm, floppy, tmp);
|
||||
}
|
||||
|
@ -49,18 +49,18 @@ protected:
|
||||
public:
|
||||
|
||||
// @cmember Effettua il backup della directory
|
||||
bool backup(const char* dir, char floppy, const char* desc, bool dummy = FALSE);
|
||||
bool backup(const char* dir, char floppy, const char* desc);
|
||||
// @cmember Effettua il backup della directory in un percorso specificato
|
||||
bool backup(const char* dir, const char* dirdest, const char* desc, bool dummy = FALSE) const;
|
||||
bool backup(const char* dir, const char* dirdest, const char* desc) const;
|
||||
// @cmember Effettua il backup della ditta
|
||||
bool backup(int mode, long firm, char floppy, const char* desc, bool pr_set=TRUE);
|
||||
bool backup(int mode, long firm, char floppy, const char* desc);
|
||||
|
||||
// @cmember Effettua il restore della directory
|
||||
bool restore(const char* dir, char floppy, bool temp, bool dummy = FALSE);
|
||||
bool restore(const char* dir, char floppy, bool temp);
|
||||
// @cmember Effettua il restore della directory
|
||||
bool restore(const char* dir, const char* fromdir, bool temp, bool dummy = FALSE);
|
||||
bool restore(const char* dir, const char* fromdir, bool temp);
|
||||
// @cmember Effettua il restore della ditta
|
||||
bool restore(int mode, long firm, char floppy, bool temp, bool pr_set=TRUE);
|
||||
bool restore(int mode, long firm, char floppy, bool temp);
|
||||
|
||||
// @cmember Effettua il backup della directory
|
||||
bool zip(const char* dir, char floppy, const char* desc);
|
||||
|
@ -213,9 +213,9 @@ void TDeletedoc_app::backup_delete_doc(int op, int who, bool pack_rows)
|
||||
const char * dir = &_tmp_dir[1];
|
||||
delete_tmp_files(FALSE); //Close tmp files only
|
||||
if(_floppy)
|
||||
rt = _arc.backup(dir, _unit, _desc, FALSE); // Backup dei documenti da eliminare, prefix unnecessary
|
||||
rt = _arc.backup(dir, _unit, _desc); // Backup dei documenti da eliminare, prefix unnecessary
|
||||
else
|
||||
rt = _arc.backup(dir, _dirdest, _desc, FALSE); // Backup dei documenti da eliminare, prefix unnecessary
|
||||
rt = _arc.backup(dir, _dirdest, _desc); // Backup dei documenti da eliminare, prefix unnecessary
|
||||
create_tmp_files(FALSE); // Reopen tmp files.
|
||||
doc.open(_excllock); rdoc.open(); clifo.open();
|
||||
cfven.open(); tab.open(); occas.open();
|
||||
@ -292,9 +292,9 @@ void TDeletedoc_app::restore_doc()
|
||||
const char* dir =& _tmp_dir[1]; // Cut out % sign
|
||||
bool ok;
|
||||
if(_floppy)
|
||||
ok = _arc.restore(dir, _unit, FALSE, FALSE);
|
||||
ok = _arc.restore(dir, _unit, FALSE);
|
||||
else
|
||||
ok = _arc.restore(dir, _dirdest, FALSE, FALSE);
|
||||
ok = _arc.restore(dir, _dirdest, FALSE);
|
||||
if (ok)
|
||||
{
|
||||
create_tmp_files(FALSE); // In realta' ci sono gia'
|
||||
|
@ -78,12 +78,11 @@ public:
|
||||
|
||||
bool TArchive_doc::create()
|
||||
{
|
||||
/* open_files(LF_TABCOM, LF_TAB, LF_CLIFO, LF_OCCAS, LF_INDSP, LF_CFVEN,
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CLIFO, LF_OCCAS, LF_INDSP, LF_CFVEN,
|
||||
LF_DOC, LF_RIGHEDOC, LF_ANAMAG, LF_MOVMAG, LF_RMOVMAG, LF_CONDV,
|
||||
LF_SVRIEP, LF_AGENTI, LF_PERCPROV, LF_CESS, 0);*/
|
||||
_tmp_dir.temp();
|
||||
_tmp_dir = _tmp_dir.path();
|
||||
_tmp_dir << "VE";
|
||||
LF_SVRIEP, LF_AGENTI, LF_PERCPROV, LF_CESS, 0);
|
||||
_tmp_dir.tempdir();
|
||||
_tmp_dir.add("VE");
|
||||
if (!_tmp_dir.exist()) make_dir(_tmp_dir);
|
||||
_tmp_dir.insert("%"); // Add % sign
|
||||
|
||||
@ -169,7 +168,8 @@ void TArchive_doc::archivia(const TMask& m)
|
||||
for (cur = 0; cur.pos() < total && !pi.iscancelled() && err==NOERR; ++cur) //for cur che va da 0 alla posizione corrente (che deve essere < del numero totale
|
||||
//dei record (total) and non essere interrotto e non esserci errore
|
||||
{
|
||||
err = _tdoc->write(doc->head()); //scrive l'intestazione sul file temp delle testate
|
||||
_tdoc->curr() = doc->head();
|
||||
err = _tdoc->write(); //scrive l'intestazione sul file temp delle testate
|
||||
if (with_clifor)
|
||||
{
|
||||
TString key(doc->get(DOC_TIPOCF));
|
||||
@ -189,8 +189,9 @@ void TArchive_doc::archivia(const TMask& m)
|
||||
break;
|
||||
}
|
||||
for (int r = 1; r <= doc->physical_rows() && err==NOERR; r++) //scrive le righe sul file temp delle
|
||||
{ //righe;
|
||||
err = _trdoc->write((*doc)[r]); //scrive le righe sul file
|
||||
{
|
||||
_trdoc->curr() = (*doc)[r]; //righe;
|
||||
err = _trdoc->write(); //scrive le righe sul file
|
||||
if (err != NOERR)
|
||||
{
|
||||
error_box("Errore %d durante la copia delle righe", err);
|
||||
@ -207,27 +208,35 @@ void TArchive_doc::archivia(const TMask& m)
|
||||
if (*dir == '%')
|
||||
dir++;
|
||||
|
||||
bool rt = _arc.backup(dir,_unit,_desc, TRUE); //esegue la compressione ed il salvataggio sul device scelto
|
||||
bool rt = 0;
|
||||
TFilename unit;
|
||||
TFilename tmpdir;
|
||||
|
||||
tmpdir.tempdir();
|
||||
|
||||
unit << _unit << ":" << SLASH;
|
||||
|
||||
if (xvt_fsys_is_removable_drive(unit)) //esegue la compressione ed il salvataggio sul device scelto
|
||||
_arc.backup(dir, _unit, _desc);
|
||||
else
|
||||
_arc.backup(dir, tmpdir, _desc);
|
||||
|
||||
create_tmp_files(false); //apre i files temp, riallocandoli (NON li crea effettvam.)
|
||||
delete_tmp_files(true); //cancella fisicamente i files temp
|
||||
|
||||
TFilename unit;
|
||||
|
||||
unit << _unit << ':' << SLASH;
|
||||
|
||||
if (!xvt_fsys_is_removable_drive(unit) && _path != "") //se il drive non e' rimovibile,sposta i files dalla root del drive
|
||||
{ //alla target dir scritta sulla maschera
|
||||
for (int i = 0; i <= 1; i++)
|
||||
{
|
||||
TFilename orig = unit;
|
||||
|
||||
TFilename orig = tmpdir;
|
||||
TFilename dest;
|
||||
dest << unit << _path;
|
||||
const char * name = i == 0 ? "backup.ini" : "ve.z00";
|
||||
orig << name;
|
||||
dest << _unit << ":\\" << _path;
|
||||
const char * name = "ve.zip";
|
||||
orig << SLASH << name;
|
||||
dest << SLASH << name;
|
||||
|
||||
fcopy(orig, dest);
|
||||
xvt_fsys_remove_file(orig); //elimina il file di origine dopo averlo copiato
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -287,8 +296,13 @@ bool TArchive_doc::ripristina(const TMask& m)
|
||||
TFilename src;
|
||||
src << _unit << ':' << SLASH;
|
||||
if (!xvt_fsys_is_removable_drive(src) && _path.full())
|
||||
{
|
||||
src.add(_path);
|
||||
src.add("ve.z00");
|
||||
src.add("ve.zip");
|
||||
}
|
||||
else
|
||||
src.add("ve.z00");
|
||||
|
||||
if (!src.exist())
|
||||
return cantread_box(src);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user