Patch level : 4.0 814

Files correlati     :  ca0.exe ca2.exe ve0.exe
Ricompilazione Demo : [ ]
Commento            :

Bug    0000777: RIcerca commesse centri di costo e fasi

Prevedere un filtro per utente nelle ricerche su commesse centri di costo e fasi


git-svn-id: svn://10.65.10.50/trunk@15768 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2007-11-20 11:33:49 +00:00
parent d428c5f3eb
commit 1454f858cb
4 changed files with 134 additions and 2 deletions

View File

@ -5,6 +5,7 @@
#include "calib01.h"
#include "calibmsk.h"
#include "catbauc.h"
////////////////////////////////////////////////////////////////////////
//MASCHERA GENERICA DI TABELLA NON GERARCHICA
@ -96,7 +97,9 @@ protected: // TRelation_application
virtual bool user_destroy() ;
virtual bool user_create() ;
virtual int rewrite(const TMask& m);
virtual void init_query_mode(TMask& m);
virtual void init_query_insert_mode(TMask& m);
virtual TMask * set_mask(TMask * _m=NULL);
public:
@ -154,6 +157,23 @@ int Tab_app_ca::rewrite(const TMask& m)
return Tab_application::rewrite(m);
}
void Tab_app_ca::init_query_mode(TMask& m)
{
Tab_application::init_query_mode(m);
m.show_default();
if (get_tabname() == "%AUC")
m.hide(F_AUC_CODICE1);
// set_mode(MODE_QUERY);
}
void Tab_app_ca::init_query_insert_mode(TMask& m)
{
Tab_application::init_query_mode(m);
m.show_default();
if (get_tabname() == "%AUC")
m.hide(F_AUC_CODICE);
}
int ca0100(int argc, char* argv[])
{
Tab_app_ca a;

View File

@ -370,7 +370,43 @@ static void ca_append_select_clause(ostream& out, int level, int logic, bool upp
}
str << ')';
}
if (str.not_empty())
TString16 fieldname;
switch (logic)
{
case LF_COMMESSE:
fieldname = "S0";
break;
case LF_CDC:
fieldname = "S1";
break;
case LF_FASI:
fieldname = "S2";
break;
default:
break;
}
if (fieldname.full())
{
const TString utente(user());
const TString gruppo(cache().get(LF_USER, utente,"GROUPNAME"));
TString condition;
if (gruppo.full())
condition = cache().get("%AUC", gruppo, fieldname);
if (utente.full())
condition = cache().get("%AUC", utente, fieldname);
if (condition.full())
{
if (str.full())
{
str.insert("(");
str << ")&&";
}
str << '(' << condition << ')';
}
}
if (str.full())
out << " SE " << str << '\n';
}

8
ca/catbauc.h Executable file
View File

@ -0,0 +1,8 @@
//id campi maschera catbauc (tabella selezioni per utente)
//campi normali
#define F_AUC_CODICE 101
#define F_AUC_DESCR 102
#define F_AUC_COMMESSE 103
#define F_AUC_CDC 104
#define F_AUC_FASI 105
#define F_AUC_CODICE1 106

68
ca/catbauc.uml Executable file
View File

@ -0,0 +1,68 @@
#include "catbauc.h"
TOOLBAR "" 0 -2 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Selezione archivi per Utente" -1 -1 64 6
STRING F_AUC_CODICE 25
BEGIN
PROMPT 2 2 "Utente "
USE %AUC
JOIN LF_USER INTO USERNAME==CODTAB
FIELD CODTAB
FLAGS "G"
KEY 1
INPUT CODTAB F_AUC_CODICE
DISPLAY "Utente@16" CODTAB
DISPLAY "Gruppo@16" LF_USER->GROUPNAME
DISPLAY "Descrizione@50" LF_USER->USERDESC
OUTPUT F_AUC_CODICE CODTAB
OUTPUT F_AUC_DESCR LF_USER->USERDESC
CHECKTYPE REQUIRED
END
STRING F_AUC_CODICE1 25
BEGIN
PROMPT 2 2 "Utente "
USE LF_USER
FLAGS "G"
KEY 1
INPUT USERNAME F_AUC_CODICE1
DISPLAY "Utente@16" USERNAME
DISPLAY "Gruppo@16" GROUPNAME
DISPLAY "Descrizione@50" USERDESC
OUTPUT F_AUC_CODICE1 USERNAME
OUTPUT F_AUC_DESCR USERDESC
CHECKTYPE REQUIRED
MESSGAE COPY,F_AUC_CODICE
END
STRING F_AUC_DESCR 50
BEGIN
PROMPT 2 3 "Nome "
FLAGS "D"
END
STRING F_AUC_COMMESSE 70 50
BEGIN
PROMPT 2 4 "Filtro commesse "
FIELD S0
END
STRING F_AUC_CDC 70 50
BEGIN
PROMPT 2 5 "Filtro C.D.C "
FIELD S1
END
STRING F_AUC_FASI 70 50
BEGIN
PROMPT 2 6 "Filtro Fasi "
FIELD S2
END
ENDPAGE
ENDMASK