**OVARIABILE_GLOBALE.PRG


PUBLIC gcGestPermis, gcGrupePermis,gnTipGest,gcGestPermis_Nume,gcGrupePermis_Nume
STORE '' TO gcGestPermis,gcGrupePermis,gcGestPermis_Nume,gcGrupePermis_Nume
STORE 0 TO gnTipGest

IF TYPE('gcContObInv') = 'U'
	PUBLIC gcContObInv
	gcContObInv = '8039'
ENDIF 
SET TEXTMERGE ON TO MEMVAR lcSql NOSHOW
\select DISTINCT C.ID_GRUPE, C.NUME_GRUPA
\  from <<gcS>>.VGEST_NOM_GRUPE C
\  JOIN (select id_grupe
\         from <<gcS>>.gest_nom_grupe
\         where sters = 0
\         start with ID_GRUPE IN (SELECT ID_GRUPE FROM <<gcS>>.VGEST_CORESP_UTIL_GRUPE WHERE  ID_UTIL = <<gnIdUtil>>)
\         connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe
SET TEXTMERGE TO

*!*	lcSql = [select * from ] + gcs + [.VGEST_CORESP_UTIL_GRUPE where id_util =] + ALLTRIM(STR(gnIdUtil))

lcCursor = [GRUPE_permis]
lnSucces = goExecutor.oExecute(lcSql,lcCursor)
IF lnSucces < 0
	AMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
ELSE
	SELECT grupe_permis
	SCAN
		gcGrupePermis = gcGrupePermis + ',' + ALLTRIM(STR(id_grupe))
		gcGrupePermis_Nume = gcGrupePermis_Nume + ',' + ALLTRIM(nume_grupa)
	ENDSCAN
	gcGrupePermis = SUBSTR(gcGrupePermis,2)
	gcGrupePermis_Nume = SUBSTR(gcGrupePermis_Nume,2)
	USE IN grupe_permis
ENDIF
goExecutor.oReset()
*!*	AMESSAGEBOX(gcGrupePermis_nume)

IF '-1' $ gcGrupePermis
	gcGestPermis = '-1'
ELSE
*!*		lcSql = [SELECT * FROM ] + gcs + [.VGEST_CORESP_GRUPE_GESTIUNI A JOIN ] + gcs + [.VGEST_CORESP_UTIL_GRUPE B ]+ ;
*!*		[ON A.ID_GRUPE = B.ID_GRUPE WHERE B.ID_UTIL = ] + ALLTRIM(STR(gnIdUtil))

	SET TEXTMERGE ON TO MEMVAR lcSql NOSHOW
	\select DISTINCT ID_GESTIUNE, NUME_GESTIUNE
	\ from <<gcS>>.vgest_coresp_grupe_gestiuni c
	\ join (select id_grupe
	\       from <<gcS>>.gest_nom_grupe
	\       where sters = 0
    \       start with ID_GRUPE IN (SELECT ID_GRUPE FROM <<gcS>>.VGEST_CORESP_UTIL_GRUPE WHERE  ID_UTIL = <<gnIdUtil>>)
	\       connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe
	SET TEXTMERGE TO


	lcCursor = [gest_permis]
	lnSucces = goExecutor.oExecute(lcSql,lcCursor)
	IF lnSucces < 0
		AMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
	ELSE
		SELECT gest_permis
		SCAN
			gcGestPermis = gcGestPermis + ',' + ALLTRIM(STR(id_gestiune))
			gcGestPermis_Nume = gcGestPermis_Nume + ',' + ALLTRIM(nume_gestiune)
		ENDSCAN
		gcGestPermis = SUBSTR(gcGestPermis,2)
		gcGestPermis_Nume = SUBSTR(gcGestPermis_Nume,2)
		USE IN gest_permis
	ENDIF
	goExecutor.oReset()
ENDIF
*!*	AMESSAGEBOX(gcGestPermis_nume)
*WAIT WINDOW gcGestPermis + ',' + gcGrupePermis

*****************************************************************************
*** Citesc setarea pentru ReportBehaviour
IF TYPE('gnReportBehaviour') = 'U'
	PUBLIC gnReportBehaviour 
	gnReportBehaviour = 90
ENDIF 

LOCAL lcReportBehaviour
lcReportBehaviour = NVL(getini(m.gcGeneralIniFile,'report','reportbehaviour'), '')
IF EMPTY(m.lcReportBehaviour)
	setini(m.gcGeneralIniFile,'report','reportbehaviour', '90')
	gnReportBehaviour = 90
ELSE
	gnReportBehaviour = VAL(m.lcReportBehaviour)
ENDIF 
IF !INLIST(gnReportBehaviour, 80, 90)
     setini(m.gcGeneralIniFile,'report','reportbehaviour', '90')
	 gnReportBehaviour = 90
ENDIF  
*****************************************************************************