From a32fade891b19b8375617b24b5c4babb5016067c Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 14 May 2014 08:20:53 +0000 Subject: [PATCH] =?UTF-8?q?Possibilit=C3=A0=20di=20eseguire=20contemporane?= =?UTF-8?q?amente=20pi=C3=B9=20menu=20in=20diverse=20cartelle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/branches/R_10_00@22930 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba0100.cpp | 10 ++++----- ba/ba1400.cpp | 3 ++- ba/ba1600.cpp | 31 ++++++++++++++++------------ ba/ba4300.h | 1 + ba/ba4300a.uml | 14 ++++++++++--- ba/ba8300.cpp | 24 ++++++++++++++++++++-- ba/ba8500.cpp | 56 ++++++++++++++++++++++++++++++++++++++++---------- ba/f9.dir | 2 +- ba/f9.trr | 3 ++- 9 files changed, 106 insertions(+), 38 deletions(-) diff --git a/ba/ba0100.cpp b/ba/ba0100.cpp index e6547fdfc..40f7ea49b 100755 --- a/ba/ba0100.cpp +++ b/ba/ba0100.cpp @@ -990,12 +990,9 @@ void TMenu_application::test_temp() if (count > 0 && yesno_box(TR("Cancellare tutti i file temporanei in %s?"), dir.path())) { - TProgind bar(count, TR("Cancellazione file temporanei"), true, true); - for (int i = count-1; i >= 0; i--) + TProgress_monitor bar(count, TR("Cancellazione file temporanei")); + for (int i = count-1; i >= 0 && bar.add_status(); i--) { - bar.addstatus(1); - if (bar.iscancelled()) - break; const char* e = files.row(i); ::remove(e); } @@ -1760,7 +1757,8 @@ bool TStudy_mask::is_valid_study(const char* path) const { TFilename n = path; n.add("com/dir.gen"); - return n.find(' ') < 0 && n.exist(); + //return n.find(' ') < 0 && n.exist(); + return n.find(' ') < 0 && xvt_fsys_access(n, 0x2) == 0; // NO blanks and write permission } void TStudy_mask::list_studies(TString_array& sht, bool firms_count) const diff --git a/ba/ba1400.cpp b/ba/ba1400.cpp index b54104efd..a9fd349fc 100755 --- a/ba/ba1400.cpp +++ b/ba/ba1400.cpp @@ -496,7 +496,8 @@ bool TSet_user_passwd::password_handler(TMask_field& f, KEY key) if (ok) { - const int minlen = ini_get_int(CONFIG_STUDIO, "Main", "MinPwdLen", 4); + int minlen = ini_get_int(CONFIG_STUDIO, "Main", "MinPwdLen", 4); + if (minlen > f.size()) minlen = f.size(); if (pwdlen < minlen) { TString msg; msg.format(TR("La password deve essere lunga almeno %d caratteri."), minlen); diff --git a/ba/ba1600.cpp b/ba/ba1600.cpp index 725ddd6d2..7834df31f 100755 --- a/ba/ba1600.cpp +++ b/ba/ba1600.cpp @@ -250,7 +250,7 @@ void TInstall_ini::export_paragraph(const char* module, const char* summary, con TAssoc_array& ass = list_variables(module); TString newkey,tmps; TToken_string item_value; - TString ; + FOR_EACH_ASSOC_STRING(ass, obj, key, str) { if (!remove_old && is_submodule && strncmp(key, "File", 4) == 0 ) @@ -258,31 +258,36 @@ void TInstall_ini::export_paragraph(const char* module, const char* summary, con // merging "File(X)" items... item_value=str; tmps=item_value.get(0); - int item_number=find_row(tmps, old_list); + const int item_number=find_row(tmps, old_list); if (item_number>=0) { // file sostituito - TString old_smodule(old_list.row(item_number).get(2)); + const TString old_smodule = old_list.row(item_number).get(2); TAssoc_array& oldvars = sum.list_variables(old_smodule); - THash_object* obj; + THash_object* obj = NULL; TToken_string oldvalue; oldvars.restart(); do { - obj=oldvars.get_hashobj(); - oldvalue=((TString &)obj->obj()); + obj = oldvars.get_hashobj(); + if (obj == NULL) + break; + oldvalue = ((const TString &)obj->obj()); if (tmps == oldvalue.get(0)) break; } while (obj); - newkey = obj->key(); - if (old_smodule!=module) + if (obj != NULL) { - // devo cancellare il file dal vecchio sottomodulo - sum.set_paragraph(old_smodule); - sum.remove(newkey); - sum.set_paragraph(module); - } + newkey = obj->key(); + if (old_smodule!=module) + { + // devo cancellare il file dal vecchio sottomodulo + sum.set_paragraph(old_smodule); + sum.remove(newkey); + sum.set_paragraph(module); + } + } } else { diff --git a/ba/ba4300.h b/ba/ba4300.h index 2c2f777e1..9dda5ff67 100755 --- a/ba/ba4300.h +++ b/ba/ba4300.h @@ -125,6 +125,7 @@ #define DLG_REG 188 #define F_ISCRCAF 189 #define FLD_GD1_RAGSOCH 190 +#define FLD_GD1_MAIL 191 #define FLD_GD1_VALUTA 192 #define CHK_IN_PRESELEN 195 diff --git a/ba/ba4300a.uml b/ba/ba4300a.uml index 46e021a96..21b7cb1ea 100755 --- a/ba/ba4300a.uml +++ b/ba/ba4300a.uml @@ -35,7 +35,7 @@ BEGIN FIELD LF_NDITTE->CODDITTA FLAGS "RG" KEY 1 - USE LF_NDITTE KEY 1 + USE LF_NDITTE INPUT CODDITTA FLD_GD1_CODDITTA DISPLAY "Codice" CODDITTA DISPLAY "Ragione sociale@50" RAGSOC @@ -182,9 +182,9 @@ BEGIN WARNING "Attivita' assente" END -GROUPBOX DLG_NULL 76 4 +GROUPBOX DLG_NULL 76 5 BEGIN - PROMPT 0 12 "@bTelefoni" + PROMPT 0 12 "@bRecapiti telefonici e telematici" END STRING FLD_GD1_PTEL 10 @@ -215,6 +215,14 @@ BEGIN HELP "Numero telefonico del fax della ditta" END +STRING FLD_GD1_MAIL 50 +BEGIN + PROMPT 1 15 "E-Mail : " + FIELD LF_NDITTE->MAIL + HELP "Indirizzo e-mail della ditta" +END + + STRING FLD_GD1_VALUTA 3 BEGIN PROMPT 1 17 "Codice valuta di riferimento " diff --git a/ba/ba8300.cpp b/ba/ba8300.cpp index 085f7e002..c47590245 100755 --- a/ba/ba8300.cpp +++ b/ba/ba8300.cpp @@ -511,11 +511,31 @@ bool TReport_mask::get_rep_path(TFilename& path) const xvt_fsys_mkdir(path); path.add(name); path.ext("rep"); - if (!path.exist() && is_power_station()) + bool found = path.exist(); + if (!found) + { + TString80 fname = path.name_only(); fname.lower(); + TFilename star = path.path(); star.add("*.rep"); + TString_array reps; + list_files(star, reps); + double best = 0.8; + FOR_EACH_ARRAY_ROW(reps, r, row) + { + star = *row; star = star.name_only(); star.lower(); + const double s = xvt_str_fuzzy_compare(star, fname); + if (s > best) + { + path = *row; + best = s; + found = true; + } + } + } + if (!found && is_power_station()) { path = name; path.ext("rep"); - path.custom_path(); + found = path.custom_path(); } } path.ext("rep"); diff --git a/ba/ba8500.cpp b/ba/ba8500.cpp index 53dc0b206..1c42ebbd0 100755 --- a/ba/ba8500.cpp +++ b/ba/ba8500.cpp @@ -155,22 +155,29 @@ void TKlarkKent_app::main_loop() { TString_array arr; // Lista dei reports TAssoc_array vars; // Variabili utente + bool trans = false; + TString80 name, val; for (int i = 2; i < argc(); i++) { const TFixed_string arg(argv(i)); const int uguale = arg.find('='); if (uguale > 0) { - TString16 name = arg.left(uguale); name.trim(); - TString80 val = arg.mid(uguale+1); val.trim(); - if (name.full() && val.full()) + name = arg.left(uguale); name.trim(); + val = arg.mid(uguale+1); val.trim(); + if (name.full()) { TVariant* var = NULL; - if (real::is_real(val)) - var = new TVariant(real(val)); + if (val.full()) + { + if (real::is_real(val)) + var = new TVariant(real(val)); + else + var = new TVariant(val); + } else - var = new TVariant(val); + var = new TVariant; if (name[0] != '#') name.insert("#"); vars.add(name, var); @@ -178,10 +185,37 @@ void TKlarkKent_app::main_loop() } else { - TFilename rep = arg; - rep.ext("rep"); - if (rep.custom_path()) - arr.add(arg); + if (arg.starts_with("-i")) + { + trans = true; + TFilename ininame = arg.mid(2); + TConfig ini(ininame, "Vars"); + TAssoc_array& inivars = ini.list_variables(); + FOR_EACH_ASSOC_STRING(inivars, obj, key, str) + { + TVariant* var = NULL; + if (str && *str) + { + if (real::is_real(str)) + var = new TVariant(real(str)); + else + var = new TVariant(str); + } + else + var = new TVariant; + name = key; + if (name[0] != '#') + name.insert("#"); + vars.add(name, var); + } + } + else + { + TFilename rep = arg; + rep.ext("rep"); + if (rep.custom_path()) + arr.add(arg); + } } } @@ -246,7 +280,7 @@ void TKlarkKent_app::main_loop() pset->set_var(name, *(TVariant*)var, true); } const bool ok = book.add(*report); - if (ok && arr.items() == 1) // Controlla se e' pensabile ripetere la stampa + if (ok && !trans && arr.items() == 1) // Controlla se e' pensabile ripetere la stampa { TFilename msk = report_name; msk.ext("msk"); diff --git a/ba/f9.dir b/ba/f9.dir index aafe77aee..5ea60b9e9 100755 --- a/ba/f9.dir +++ b/ba/f9.dir @@ -1,3 +1,3 @@ 9 1 -%nditte|0|0|571|0|Ditte|#6|| +%nditte|0|0|621|0|Ditte|#6|| diff --git a/ba/f9.trr b/ba/f9.trr index 72bbc2f3e..54530a864 100755 --- a/ba/f9.trr +++ b/ba/f9.trr @@ -1,5 +1,5 @@ 9 -55 +56 CODDITTA|3|5|0| TIPOA|1|1|0| CODANAGR|3|5|0| @@ -9,6 +9,7 @@ PTEL|1|10|0| TEL|1|30|0| PFAX|1|10|0| FAX|1|30|0| +MAIL|1|50|0| NULC|2|3|0| ARTIG|8|1|0| NISCRAA|1|10|0|