Patch level : 10.0 1024

Files correlati     : ba0, ba1, ba8
Ricompilazione Demo : [ ]
Commento            :
Corretta gestione permessi utente per esecuzione delle singole applcazioni (Possamai)
Corretto aggiornamento albero quando si elimina una sezione nell'editor di report


git-svn-id: svn://10.65.10.50/branches/R_10_00@22247 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-06-09 11:06:57 +00:00
parent 89d22e2b8c
commit 01d48b37a9
5 changed files with 81 additions and 34 deletions

View File

@ -189,8 +189,8 @@ bool TMenuitem::create(const char* t)
_exist = _enabled = false; _exist = _enabled = false;
// Controlla lo stato di aggiornamento // Controlla lo stato di aggiornamento
if (_enabled && is_program()) //if (_enabled && is_program())
_enabled = !menu().is_dangerous(_action) && !menu().is_vanished(_action); // _enabled = !menu().is_dangerous(_action) && !menu().is_vanished(_action);
return visible; return visible;
} }
@ -221,7 +221,8 @@ bool TMenuitem::enabled() const
} }
else else
{ {
yes = !menu().is_dangerous(_action); // Controlla lo stato di aggiornamento
yes = !menu().is_dangerous(_action) && !menu().is_vanished(_action);
if (yes) if (yes)
{ {
const int endname = _action.find(' '); const int endname = _action.find(' ');
@ -337,6 +338,12 @@ bool TMenuitem::perform_program() const
{ {
TCurrency::force_cache_update(); // Chiude cache valute TCurrency::force_cache_update(); // Chiude cache valute
TExternal_app a(_action); TExternal_app a(_action);
if (!a.can_run())
{
((TMenuitem*)this)->_enabled = false; // Controllo sfuggito al caricamento del menu
return error_box(FR("L'utente %s non è abilitato all'uso del programma\n%s"),
(const char*)user(), (const char*)caption());
}
const bool install_app = _action.starts_with("ba1 -6", true); const bool install_app = _action.starts_with("ba1 -6", true);
if (install_app) if (install_app)

View File

@ -10,24 +10,15 @@ int main(int argc,char** argv)
switch (r) switch (r)
{ {
case 1: case 1: ba1200(argc,argv); break; // Test file
ba1200(argc,argv); break; // Test file case 2: ba1300(argc,argv); break; // Compattazione files
case 2: case 3: ba1400(argc,argv); break; // Configurazione utenti
ba1300(argc,argv); break; // Compattazione files case 4: ba1500(argc,argv); break; // Attivazione moduli
case 3: case 5: ba1600(argc,argv); break; // Creazione dischi e fascicolatore
ba1400(argc,argv); break; // Configurazione utenti case 6: ba1700(argc,argv); break; // Installazione moduli
case 4: case 7: ba1800(argc,argv); break; // Utility(?)
ba1500(argc,argv); break; // Attivazione moduli case 8: ba1900(argc,argv); break; // Dizionario
case 5: default: ba1100(argc,argv); break; // Manutenzione
ba1600(argc,argv); break; // Creazione dischi e fascicolatore
case 6:
ba1700(argc,argv); break; // Installazione moduli
case 7:
ba1800(argc,argv); break; // Utility(?)
case 8:
ba1900(argc,argv); break; // Dizionario
default:
ba1100(argc,argv); break; // Manutenzione
} }
return 0; return 0;
} }

View File

@ -20,6 +20,9 @@
class TMenu_item : public TString class TMenu_item : public TString
{ {
TString _cmd; TString _cmd;
protected:
int get_next_string(const char* s, int from, TString& str, char& brace) const;
public: public:
virtual TObject* dup() const { return new TMenu_item(*this); } virtual TObject* dup() const { return new TMenu_item(*this); }
@ -31,20 +34,65 @@ public:
virtual ~TMenu_item() { } virtual ~TMenu_item() { }
}; };
int TMenu_item::get_next_string(const char* s, int from, TString& str, char& brace) const
{
if (from < 0)
return -1;
char closing = '\0';
int start = 0;
for (int i = from; s[i]; i++)
{
if (s[i] == closing)
{
char* fine = (char*)(s + i);
const char old = *fine;
*fine = '\0';
str = s + start;
*fine = old;
return i+1;
}
if (!closing)
{
switch(s[i])
{
case '\'':
case '"' : closing = s[i]; break;
case '<' : closing = '>' ; break;
case '[' : closing = ']' ; break;
default : break;
}
if (closing)
{
start = i+1;
brace = s[i];
}
}
}
return -1;
}
TMenu_item::TMenu_item(const TMenu_item& mi) TMenu_item::TMenu_item(const TMenu_item& mi)
: _cmd(mi._cmd) : _cmd(mi._cmd)
{ set(*this); } { set(*this); }
TMenu_item::TMenu_item(const char* line) TMenu_item::TMenu_item(const char* line)
{ {
TToken_string ts(line, ','); char brace;
set(ts.get(0)); trim(); int start = 0;
if (operator[](0) == '"') start = get_next_string(line, start, *this, brace);
{ ltrim(1); rtrim(1); } start = get_next_string(line, start, _cmd, brace);
if (brace == '[') // Preserva il tipo submenu
_cmd = ts.get(); _cmd.trim(); {
if (_cmd[0] == '"') _cmd.insert("[");
{ _cmd.ltrim(1); _cmd.rtrim(1); } _cmd << ']';
}
if (_cmd.starts_with("ve0 -1 "))
int cazzone = 1;
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -535,7 +583,7 @@ bool TSet_users::p_notify(TSheet_field& f, int r, KEY k)
case K_INS: case K_INS:
{ {
TMask& m = f.mask(); TMask& m = f.mask();
if (m.get(F_APPLICAT).empty()) if (m.field(F_APPLICAT).empty())
return error_box(TR("Nessun programma selezionato")); return error_box(TR("Nessun programma selezionato"));
} }
default: default:
@ -774,7 +822,7 @@ int TSet_user_passwd::rewrite(const TMask& m)
bool TSet_users::remove() bool TSet_users::remove()
{ {
const TString16 u = get_relation()->curr().get(USR_USERNAME); const TString u = get_relation()->curr().get(USR_USERNAME);
const bool ok = TRelation_application::remove(); const bool ok = TRelation_application::remove();
if (ok && u.full()) if (ok && u.full())
{ {

View File

@ -1781,7 +1781,7 @@ TInstaller_mask::TInstaller_mask()
0x18, 4) 0x18, 4)
{ {
add_button(F_INSTALL, TR("Installa"), '\0', TOOL_ELABORA); // NON mettere 'I' add_button(F_INSTALL, TR("Installa"), '\0', TOOL_ELABORA); // NON mettere 'I'
add_button(F_UPDATE, TR("Rileggi"), '\0', TOOL_CONVERT); add_button(F_UPDATE, TR("Aggiorna Lista"), '\0', TOOL_CONVERT);
add_button(DLG_NULL, "", '\0'); add_button(DLG_NULL, "", '\0');
add_button(DLG_INFO, TR("Info"), K_F2, TOOL_INFO); add_button(DLG_INFO, TR("Info"), K_F2, TOOL_INFO);
add_button(DLG_HELP, TR("Help"), K_F1, TOOL_HELP); add_button(DLG_HELP, TR("Help"), K_F1, TOOL_HELP);

View File

@ -923,12 +923,14 @@ void TReport_mask::section_properties()
{ {
TReport_section& rs = curr_section(); TReport_section& rs = curr_section();
TSection_properties_mask m(rs); TSection_properties_mask m(rs);
bool dirty = false;
switch (m.run()) switch (m.run())
{ {
case K_ENTER: case K_ENTER:
m.get_section(rs); m.get_section(rs);
_tree.goto_node(rs.type(), rs.level()); _tree.goto_node(rs.type(), rs.level());
_is_dirty = true; _is_dirty = true;
select_section(true);
break; break;
case K_DEL: case K_DEL:
if (yesno_box(TR("Confermare l'eliminazione della sezione"))) if (yesno_box(TR("Confermare l'eliminazione della sezione")))
@ -938,13 +940,12 @@ void TReport_mask::section_properties()
rs.report().kill_section(t, l); rs.report().kill_section(t, l);
_tree.goto_node(t, l-1); _tree.goto_node(t, l-1);
_is_dirty = true; _is_dirty = true;
select_section(true);
} }
break; break;
default: default:
break; break;
} }
if (_is_dirty)
select_section();
} }
void TReport_mask::report_properties() void TReport_mask::report_properties()