*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="accesindivid.scx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS dataenvironment AS dataenvironment 
 	*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="1" />

	*<PropValue>
		DataSource = .NULL.
		Height = 0
		Left = 0
		Name = "Dataenvironment"
		Top = 0
		Width = 0
	*</PropValue>

ENDDEFINE

DEFINE CLASS formtermin1 AS formtermin OF "..\comun\clase\baza.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="TEXT_ITEM1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label_item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label_item2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label_item3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="List1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="List2" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 318
		Name = "Formtermin1"
		Width = 456
		Shape1.Height = 32
		Shape1.Left = 0
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 455
		TERMINAT1.COMMAND1.Name = "COMMAND1"
		TERMINAT1.IMBUTON1.Height = 27
		TERMINAT1.IMBUTON1.Name = "IMBUTON1"
		TERMINAT1.IMBUTON1.Width = 30
		TERMINAT1.Left = 424
		TERMINAT1.Name = "TERMINAT1"
		TERMINAT1.Top = 1
		TITLUFRUMOS1.Caption = "Grupe de acces"
		TITLUFRUMOS1.Height = 25
		TITLUFRUMOS1.Left = 8
		TITLUFRUMOS1.Name = "TITLUFRUMOS1"
		TITLUFRUMOS1.Top = 4
		TITLUFRUMOS1.Width = 364
	*</PropValue>

	ADD OBJECT 'Label_item1' AS label_item WITH ;
		AutoSize = .F., ;
		Caption = "Are drepturi de acces asupra grupelor de gestiuni :", ;
		Height = 32, ;
		Left = 14, ;
		Name = "Label_item1", ;
		Top = 106, ;
		Width = 198, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label_item2' AS label_item WITH ;
		AutoSize = .F., ;
		Caption = "Gestiunile:", ;
		Height = 32, ;
		Left = 242, ;
		Name = "Label_item2", ;
		Top = 106, ;
		Width = 198, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label_item3' AS label_item WITH ;
		Caption = "Are drepturi de acces asupra tuturor gestiunilor.", ;
		Left = 12, ;
		Name = "Label_item3", ;
		Top = 72, ;
		Visible = .F.
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'List1' AS listbox WITH ;
		BorderColor = 0,64,128, ;
		FontName = "Arial Narrow", ;
		Height = 157, ;
		ItemBackColor = 217,241,255, ;
		Left = 12, ;
		Name = "List1", ;
		RowSourceType = 1, ;
		SpecialEffect = 1, ;
		Top = 144, ;
		Width = 205
		*< END OBJECT: BaseClass="listbox" />

	ADD OBJECT 'List2' AS listbox WITH ;
		BorderColor = 0,64,128, ;
		FontName = "Arial Narrow", ;
		Height = 157, ;
		ItemBackColor = 217,241,255, ;
		Left = 240, ;
		Name = "List2", ;
		RowSourceType = 1, ;
		SpecialEffect = 1, ;
		Top = 144, ;
		Width = 205
		*< END OBJECT: BaseClass="listbox" />

	ADD OBJECT 'TEXT_ITEM1' AS text_item WITH ;
		ControlSource = "", ;
		FontBold = .T., ;
		FontUnderline = .T., ;
		Height = 20, ;
		Left = 12, ;
		Name = "TEXT_ITEM1", ;
		Top = 48, ;
		Width = 240
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Init
		
		PRIVATE pcutil
		STORE '' TO pcutil
		
		*Are drepturi de acces asupra grupelor de gestiuni cu numerele:
		*Are drepturi de acces asupra tuturor gestiunilor.
		*Gestiuni cu indicativele:
		
		lcSql = [select utilizator from utilizatori where id_util = ] + ALLTRIM(STR(gnidutil))
		lcCursor = [crsUtil]
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		IF lnSucces < 0
			lcMesaj = goExecutor.cEroare
			ofrm_eroare =CREATEOBJECT('frm_mesaj',[Eroare],[exclam.ico],[Avertizare],lcMesaj)
			ofrm_eroare.show()
			RELEASE ofrm_eroare
			return
		ENDIF
		
		pcutil = &lcCursor..utilizator
		this.text_item1.ControlSource = [pcutil]
		
		IF '-1'$gcGrupePermis
			this.label_item1.Visible=.f.
			this.label_item2.Visible=.f.
			this.list1.Visible=.f.
			this.list2.Visible=.f.
			this.label_item3.Visible=.t.
		ENDIF
		
		IF EMPTY(gcGrupePermis_nume)
			this.label_item1.Caption = [Nu are drepturi pe grupe de gestiuni!]
			this.list1.Visible=.f.
		ENDIF 
		
		IF EMPTY(gcGestPermis_nume)
			this.label_item2.Caption = [Nu are drepturi pe gestiuni!]
			this.list2.Visible=.f.
		ENDIF 
		
		this.list1.RowSource = (gcGrupePermis_nume)
		this.list2.RowSource = (gcGestPermis_nume)
		
		
	ENDPROC

ENDDEFINE
