IF APP1 = NIL
LDEFAPP := .F.
FOR DNUM = 1 TO 11
AADD(TBTN,NIL)
NEXT
IF ! NETOPEN("SAVVISI",,5,"VISI")
RETURN NIL
ENDIF
VISI->(ORDSETFOCUS("IDPVIS"))
IF ! NETOPEN("SAVPVIS",,5,"PVIS")
RETURN NIL
ENDIF
PVIS->(ORDSETFOCUS("CLI"))
IF ! NETOPEN("SAVAPPEH",,5,"APPEH") // HISTORIQUE
RETURN NIL
ENDIF
APPEH->(ORDSETFOCUS("DATE"))
IF ! NETOPEN("SAVAPPEL",,5,"APPEL")
RETURN NIL
ENDIF
ASTRU := APPEL->(DBSTRUCT())
APPEL->(ORDSETFOCUS("DATE"))
APPEL->(DBGOTOP())
DEFINE FONT aFONT NAME "Tahoma" SIZE 0,-14 BOLD
DEFINE WINDOW APP1 TITLE " " MDICHILD OF APPWND
DEFINE BUTTONBAR oBar OF APP1 SIZE 50,50 3D
DEFINE BUTTON TBTN[01] FILE DIRAPPLI() + "BMP\NOUVEAU.BMP" OF OBAR ;
ACTION APPNEW(TABSEC,OBRWAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU)
TBtn[01]:cToolTip = "Nouveau Message"
DEFINE BUTTON TBTN[03] FILE DIRAPPLI() + "BMP\MODIFIER.BMP" OF OBAR ;
ACTION APPMAJ(TABSEC,OBRWAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU)
TBtn[03]:cToolTip = "Modifier Appel"
DEFINE BUTTON TBTN[04] FILE DIRAPPLI() + "BMP\SUPPRIMER.BMP" OF OBAR ;
ACTION SUPAPPEL(OBRWAPP)
TBTN[04]:cToolTip = "Supprimer Appel"
DEFINE BUTTON TBTN[05] FILE DIRAPPLI() + "BMP\LETTRED.BMP" OF OBAR ;
ACTION TRAITAPPEL(OBRWAPP,DNUM,DNOM,ASTRU)
TBTN[05]:cToolTip = "Traiter l'appel"
DEFINE BUTTON TBTN[09] FILE DIRAPPLI() + "BMP\PRINT2.BMP" OF OBAR ;
ACTION LISTAPPEL(,OBRWAPP,"APPEL")
TBTN[09]:cToolTip = "Liste des Appels"
DEFINE BUTTON TBTN[10] FILE DIRAPPLI() + "BMP\PLANNING.BMP" OF OBAR ;
ACTION PLANNINGDEP(TABSEC,APPEL->CLI,APPEL->IDMOTIF,APPEL->CLINOM)
TBTN[10]:cToolTip = "Planning"
DEFINE BUTTON TBTN[11] FILE DIRAPPLI() + "BMP\MESSAGES.BMP" OF OBAR ;
ToolTip "Messagerie" ;
ACTION SAVMSG(DNUM,DNOM)
TBTN[11]:cToolTip = "Messagerie"
DEFINE BUTTON FILE DIRAPPLI() + "BMP\EVENEMENT.BMP" OF OBAR ;
ToolTip "Gestion des Evénements";
ACTION SAVEVENT()
DEFINE BUTTON FILE DIRAPPLI() + "BMP\DEFAUT.BMP" OF OBAR ;
ToolTip "Restituer tailles colonnes" ;
ACTION (LDEFAPP := .T., RESETDEF(@obrwAPP,ADEF,@ASIZE,,"X"),ASIZE := {},oBrwAPP:GetDisplayColsWidth(@ASIZE ),ECRSIZE("S34",ASIZE) )
FOR I = 1 TO 8
AADD(ASIZE,80)
NEXT
CREADEF(ASIZE,@ADEF)
LIRESIZE("S34",@ASIZE)
oBrwAPP := TXBrowse():New( APP1 )
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| TRNDATE(APPEL->DATE)}
oCol:cHeader := "Date" + CRLF + "Appel"
oCol:bLClickHeader := {|| APPELPRO(1,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| APPEL->HEURE }
oCol:cHeader := "Heure" + CRLF + "Appel"
oCol:bLClickHeader := {|| APPELPRO(2,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| APPEL->CLINOM }
oCol:cHeader := "Client"
oCol:bLClickHeader := {|| APPELPRO(3,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| APPEL->PERS }
oCol:cHeader := "Appel" + CRLF + "Pris par"
oCol:bLClickHeader := {|| APPELPRO(4,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| APPEL->MOTIF }
oCol:cHeader := "Motif"
oCol:bLClickHeader := {|| APPELPRO(5,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| TRNDATE(APPEL->TRAITELE) }
oCol:cHeader := "Appel" + CRLF + "Traité le"
oCol:bLClickHeader := {|| APPELPRO(6,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| APPEL->PERSPAR }
oCol:cHeader := "Traité" + CRLF + "Par"
oCol:bLClickHeader := {|| APPELPRO(7,oBrwAPP,@NFOCUS,"APPEL") }
oCol:=oBrwAPP:AddCol()
oCol:bStrData := {|| APPELTCH("A") }
oCol:bLClickHeader := {|| APPELPRO(8,oBrwAPP,@NFOCUS,"APPEL") }
oBrwAPP:SetFont( aFont )
oBrwAPP:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }
oBrwAPP:bClrHEADER := {|| { CLR_BLUE, COULDLG("TD") } }
oBrwAPP:bSeek := {|c| DbSeek( Upper( c ) ) }
oBrwAPP:blDblClick := { | nRow, nCol, nKey | APPMAJ(TABSEC,oBrwAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU) }
oBrwAPP:bKeyDown := {|nKey| iif(nKey=VK_RETURN, APPMAJ(TABSEC,oBrwAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU) ,IF(nKey = VK_DELETE,SUPAPPEL(oBrwAPP), ) ) }
oBrwAPP:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrwAPP:lColDividerComplete := .t.
oBrwAPP:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrwAPP:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrwAPP:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }
oBrwAPP:bClrHEADER := {|| { CLR_BLUE, COULDLG("SD") } }
oBrwAPP:cAlias := "APPEL"
oBrwAPP:nHeaderLines := 2
FOR I = 1 TO LEN(oBrwAPP:aCols)
oBrwAPP:aCols[I]:nWidth := ASIZE[I]
NEXT
oBrwAPP:CreateFromCode()
APP1:oClient := oBrwAPP
ACTIVATE WINDOW APP1 MAXIMIZED VALID( APP1 := NIL, .T. ) ;
ON INIT (oBrwAPP:SETFOCUS())
AFONT:END()
ELSE
APP1:SETFOCUS()
ENDIF