Patch level : 10.0 526

Files correlati     :  ca0.exe
Ricompilazione Demo : [ ]

Aggiunto il filtro utente anche sul campo albero delle anagrafiche


git-svn-id: svn://10.65.10.50/trunk@19684 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-11-30 14:04:37 +00:00
parent 2ca2116ed9
commit c8c7acce49

View File

@ -356,6 +356,38 @@ bool ca_test_multilevel_field(TEdit_field& fld, int level)
// Utilities
///////////////////////////////////////////////////////////
static const TString & ca_create_user_select_clause(int logic)
{
TString & select = get_tmp_string(128);
const char* fieldname = NULL;
switch (logic)
{
case LF_COMMESSE:
fieldname = "S0";
break;
case LF_CDC:
fieldname = "S1";
break;
case LF_FASI:
fieldname = "S2";
break;
default:
break;
}
if (fieldname != NULL)
{
const TString utente(user());
const TString gruppo(cache().get(LF_USER, utente,"GROUPNAME"));
if (gruppo.full())
select = cache().get("%AUC", gruppo, fieldname);
if (utente.full())
select = cache().get("%AUC", utente, fieldname);
}
return select;
}
static void ca_append_select_clause(ostream& out, int level, int logic, bool upper_limit)
{
TString str;
@ -384,40 +416,16 @@ static void ca_append_select_clause(ostream& out, int level, int logic, bool upp
str << ')';
}
const char* fieldname = NULL;
switch (logic)
{
case LF_COMMESSE:
fieldname = "S0";
break;
case LF_CDC:
fieldname = "S1";
break;
case LF_FASI:
fieldname = "S2";
break;
default:
break;
}
if (fieldname != NULL)
{
const TString utente(user());
const TString gruppo(cache().get(LF_USER, utente,"GROUPNAME"));
TString condition;
const TString & condition = ca_create_user_select_clause(logic);
if (gruppo.full())
condition = cache().get("%AUC", gruppo, fieldname);
if (utente.full())
condition = cache().get("%AUC", utente, fieldname);
if (condition.full())
if (condition.full())
{
if (str.full())
{
if (str.full())
{
str.insert("(");
str << ")&&";
}
str << '(' << condition << ')';
str.insert("(");
str << ")&&";
}
str << '(' << condition << ')';
}
if (str.full())
out << " SE " << str << '\n';
@ -1189,33 +1197,7 @@ bool TAnal_tree::get_description(TString& desc) const
TAnal_tree::TAnal_tree(int logicnum)
{
TString select;
const char* fieldname = NULL;
switch (logicnum)
{
case LF_COMMESSE:
fieldname = "S0";
break;
case LF_CDC:
fieldname = "S1";
break;
case LF_FASI:
fieldname = "S2";
break;
default:
break;
}
if (fieldname != NULL)
{
const TString utente(user());
const TString gruppo(cache().get(LF_USER, utente,"GROUPNAME"));
if (gruppo.full())
select = cache().get("%AUC", gruppo, fieldname);
if (utente.full())
select = cache().get("%AUC", utente, fieldname);
}
_curs = new TCursor(new TRelation(logicnum), select);
_curs = new TCursor(new TRelation(logicnum), ca_create_user_select_clause(logicnum));
_fathfasi = 0;
if (logicnum == LF_FASI)
{