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:
parent
2ca2116ed9
commit
c8c7acce49
@ -356,6 +356,38 @@ bool ca_test_multilevel_field(TEdit_field& fld, int level)
|
|||||||
// Utilities
|
// 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)
|
static void ca_append_select_clause(ostream& out, int level, int logic, bool upper_limit)
|
||||||
{
|
{
|
||||||
TString str;
|
TString str;
|
||||||
@ -384,40 +416,16 @@ static void ca_append_select_clause(ostream& out, int level, int logic, bool upp
|
|||||||
str << ')';
|
str << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* fieldname = NULL;
|
const TString & condition = ca_create_user_select_clause(logic);
|
||||||
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;
|
|
||||||
|
|
||||||
if (gruppo.full())
|
if (condition.full())
|
||||||
condition = cache().get("%AUC", gruppo, fieldname);
|
{
|
||||||
if (utente.full())
|
if (str.full())
|
||||||
condition = cache().get("%AUC", utente, fieldname);
|
|
||||||
if (condition.full())
|
|
||||||
{
|
{
|
||||||
if (str.full())
|
str.insert("(");
|
||||||
{
|
str << ")&&";
|
||||||
str.insert("(");
|
|
||||||
str << ")&&";
|
|
||||||
}
|
|
||||||
str << '(' << condition << ')';
|
|
||||||
}
|
}
|
||||||
|
str << '(' << condition << ')';
|
||||||
}
|
}
|
||||||
if (str.full())
|
if (str.full())
|
||||||
out << " SE " << str << '\n';
|
out << " SE " << str << '\n';
|
||||||
@ -1189,33 +1197,7 @@ bool TAnal_tree::get_description(TString& desc) const
|
|||||||
TAnal_tree::TAnal_tree(int logicnum)
|
TAnal_tree::TAnal_tree(int logicnum)
|
||||||
{
|
{
|
||||||
TString select;
|
TString select;
|
||||||
const char* fieldname = NULL;
|
_curs = new TCursor(new TRelation(logicnum), ca_create_user_select_clause(logicnum));
|
||||||
|
|
||||||
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);
|
|
||||||
_fathfasi = 0;
|
_fathfasi = 0;
|
||||||
if (logicnum == LF_FASI)
|
if (logicnum == LF_FASI)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user