ba0.cpp Aggiunta gestione programmi protetti da password

ba2100b.uml  Modificata maschera scelta profili
ba2100f.uml  Abilitato campo testo fisso nei campi
ba2200.cpp   Controllato meglio il cambio disco da parte dell'utente
ba2400.cpp   Aggiornato uso della funzione TForm::validate
ba3100.cpp   Corretta gestione annullamento configurazione stampa registri
ba3300.cpp   Aggiunta chiamata on_firm_change della classe madre
prassi.mnu   Aggiunto flag di protezione da password ad alcuni programmi


git-svn-id: svn://10.65.10.50/trunk@1612 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-07-19 09:42:25 +00:00
parent 8285ab7fec
commit fdae1a4bdb
8 changed files with 294 additions and 275 deletions

View File

@ -605,6 +605,23 @@ bool TMenu_application::menu(MENU_TAG)
} }
} }
else else
{
const TString16 flags(row.get());
if (flags.find('P') >= 0)
{
TMask mask("ba0100a");
mask.disable(F_USER);
mask.set(F_USER, "SERVIZIO");
ok = FALSE;
if (mask.run() == K_ENTER)
{
const TDate oggi(TODAY);
TString16 pwd; pwd << "PRASSI" << (oggi.month() + oggi.day());
ok = pwd == mask.get(F_PASSWORD);
}
if (!ok) error_box("Password di servizio errata!\nAccesso negato.");
}
if (ok)
{ {
const TString16 module(cmd2name(option)); const TString16 module(cmd2name(option));
if (get_firm() == 0 && module.compare("cg", 2, TRUE) == 0) // Chiede ditta se necessario if (get_firm() == 0 && module.compare("cg", 2, TRUE) == 0) // Chiede ditta se necessario
@ -616,6 +633,7 @@ bool TMenu_application::menu(MENU_TAG)
} }
} }
} }
}
else else
{ {
if (m < -1) break; if (m < -1) break;

View File

@ -1,6 +1,6 @@
#include "ba2100.h" #include "ba2100.h"
PAGE "Scelta profilo" -1 -1 67 6 PAGE "Scelta profilo" -1 -1 75 6
STRING F_BASE 8 STRING F_BASE 8
BEGIN BEGIN
@ -13,7 +13,7 @@ BEGIN
DISPLAY "Descrizione@50" DESC DISPLAY "Descrizione@50" DESC
OUTPUT F_BASE TIPOPROF OUTPUT F_BASE TIPOPROF
OUTPUT F_DESC DESC OUTPUT F_DESC DESC
VALIDATE NOTEMPTY_FUNC CHECKTYPE REQUIRED
END END
NUMBER F_CODE 5 NUMBER F_CODE 5
@ -33,7 +33,7 @@ BEGIN
OUTPUT F_DESC DESC OUTPUT F_DESC DESC
END END
STRING F_DESC 40 STRING F_DESC 50
BEGIN BEGIN
PROMPT 2 3 "Descrizione " PROMPT 2 3 "Descrizione "
HELP "Descrizione profilo utente" HELP "Descrizione profilo utente"
@ -53,7 +53,7 @@ BEGIN
END END
BUTTON DLG_CANCEL 10 2 BUTTON DLG_QUIT 10 2
BEGIN BEGIN
PROMPT -33 -1 "" PROMPT -33 -1 ""
END END

View File

@ -91,9 +91,8 @@ END
STRING F_PROMPT 80 60 STRING F_PROMPT 80 60
BEGIN BEGIN
PROMPT 1 5 "Testo " PROMPT 1 5 "Testo fisso "
HELP "Eventuale testo fisso da stampare" HELP "Eventuale testo fisso da stampare"
GROUP 7
END END
// Gruppo 8 per edit formato data // Gruppo 8 per edit formato data

View File

@ -68,10 +68,26 @@ public:
FILE* TArchive::ask_disk(TFilename& name, int disk, char floppy, bool lettura) const FILE* TArchive::ask_disk(TFilename& name, int disk, char floppy, bool lettura) const
{
TFilename prev(name);
prev.ext(format("%03d", disk-1)); // File precedente
bool first = TRUE;
do
{
if (first)
{ {
message_box("Inserire il disco %d nel drive %c:", disk, floppy); message_box("Inserire il disco %d nel drive %c:", disk, floppy);
first = FALSE;
}
else
{
const bool ok = yesno_box("Inserire il disco %d nel drive %c\n"
"Estrarre il disco %d e continuare?", disk, floppy, disk-1);
if (!ok) return NULL;
}
} while (fexist(prev)); // Non facciamo i furbetti!
name.ext(format("%03d", disk)); name.ext(format("%03d", disk)); // File attuale
FILE* f = NULL; FILE* f = NULL;
bool retry = TRUE; bool retry = TRUE;
@ -197,9 +213,6 @@ bool TArchive::fsplit(const char* filename, char floppy, const char* desc) const
TFilename parag(work.name()); parag.ext(""); TFilename parag(work.name()); parag.ext("");
TFilename ini("a:/backup.ini"); ini[0] = floppy; TFilename ini("a:/backup.ini"); ini[0] = floppy;
bool asked = FALSE;
while (!asked)
{
if (fexist(ini)) if (fexist(ini))
{ {
TConfig c(ini, parag); TConfig c(ini, parag);
@ -209,26 +222,12 @@ bool TArchive::fsplit(const char* filename, char floppy, const char* desc) const
ok = yesno_box("Il disco %d contiene gia' un backup del direttorio %s del %s" ok = yesno_box("Il disco %d contiene gia' un backup del direttorio %s del %s"
"\nSi desidera continuare?", "\nSi desidera continuare?",
disk, (const char*)parag, (const char*)c.get("Date")); disk, (const char*)parag, (const char*)c.get("Date"));
asked = TRUE;
}
else
{
if (d > 0)
{
ok = yesno_box("Inserire il disco %d nel drive %c:"
"\nSi desidera continuare?", disk, floppy);
if (!ok) break;
}
else
asked = TRUE;
} }
} }
else else
{ {
FILE* i = fopen(ini, "w"); // Crea il file backup.ini FILE* i = fopen(ini, "w"); // Crea il file backup.ini per evitare messaggi
fclose(i); fclose(i);
asked = TRUE;
}
} }
if (!ok) break; if (!ok) break;

View File

@ -15,7 +15,7 @@ class TTab_form : public TForm
TString256 _result; TString256 _result;
protected: protected:
virtual const char* validate(const char* v, TToken_string& s); virtual bool validate(TForm_item& f, TToken_string& s);
virtual word set_body(word p, bool u); virtual word set_body(word p, bool u);
public: public:
@ -47,7 +47,7 @@ word TTab_form::set_body(word p, bool u)
} }
const char* TTab_form::validate(const char* v, TToken_string& s) bool TTab_form::validate(TForm_item& fld, TToken_string& s)
{ {
const TString16 code(s.get(0)); const TString16 code(s.get(0));
@ -102,9 +102,10 @@ const char* TTab_form::validate(const char* v, TToken_string& s)
_result = " "; _result = " ";
_result << " " << desc; _result << " " << desc;
return _result; fld.set(_result);
return TRUE;
} }
return TForm::validate(v, s); return TForm::validate(fld, s);
} }

View File

@ -21,7 +21,7 @@ protected: // TRelation_application
virtual bool protected_record(TRectype& rec) ; virtual bool protected_record(TRectype& rec) ;
virtual void init_insert_mode(TMask& m) ; virtual void init_insert_mode(TMask& m) ;
virtual void init_modify_mode(TMask& m); virtual void init_modify_mode(TMask& m);
virtual int write(TMask& m); virtual int rewrite(const TMask& m);
public: public:
bool exist_journal() {return _exist_journal;} bool exist_journal() {return _exist_journal;}
@ -175,7 +175,7 @@ bool TGeneric_table_app::user_create()
return TRUE; return TRUE;
} }
int TGeneric_table_app::write(TMask& m) int TGeneric_table_app::rewrite(const TMask& m)
{ {
if (get_tabname() == "REG" && !m.get_bool(F_CONFIG)) if (get_tabname() == "REG" && !m.get_bool(F_CONFIG))
{ {
@ -188,7 +188,7 @@ int TGeneric_table_app::write(TMask& m)
ini.set("Type", -1); ini.set("Type", -1);
} }
return Tab_application::write(m); return Tab_application::rewrite(m);
} }
int ba3100(int argc, char* argv[]) int ba3100(int argc, char* argv[])

View File

@ -144,6 +144,8 @@ void BA3300_application::set_page(int , int counter)
void BA3300_application::on_firm_change() void BA3300_application::on_firm_change()
{ {
TPrintapp::on_firm_change();
_msk->reset(); _msk->reset();
_nditte->setkey(1); _nditte->setkey(1);
_codice_ditta = get_firm(); _codice_ditta = get_firm();

View File

@ -144,11 +144,11 @@
16|Servizio| 16|Servizio|
16|Copia Archivi|cg4 -1 16|Copia Archivi|cg4 -1
16|Ripristino stampa registri|cg5 -4 16|Ripristino stampa registri|cg5 -4
16|Aggiornamento tipo conto|cg1 -2 T 16|Aggiornamento tipo conto|cg1 -2 T|P
16|Aggiornamento tipo attivita'|cg1 -2 A 16|Aggiornamento tipo attivita'|cg1 -2 A|P
16|Aggiornamento flag op.intrac.|cg1 -2 I 16|Aggiornamento flag op.intrac.|cg1 -2 I|P
16|Aggiornamento codice attivita'|cg1 -2 C 16|Aggiornamento codice attivita'|cg1 -2 C|P
16|Rinumerazione n° protocollo|cg1 -2 P 16|Rinumerazione n. protocollo|cg1 -2 P|P
17|Modello 770|5 17|Modello 770|5
17|Immissione dichiarazione|776mod -1 17|Immissione dichiarazione|776mod -1
17|Manutenzione dichiarazione|776mod -0 17|Manutenzione dichiarazione|776mod -0