Subroutine Master_Schedule_Control_Base_Settings(Window, Param1)

/******************************************************************************************************** 

    This program is proprietary and is not to be used by or disclosed to others, nor is it to
    be copied without written permission from SRP Computer Solutions, Inc.

    Name        :   Master Schedule Control Base Settings

    Description :   

    Tags		:	[SRP]

    Parameters  :

    History (Date, Initials, Notes)
        09/17/08    fjt     Initial development
        01/08/10	fjt		Changed to 24 hour view
		02/06/10	fjt		Updated to use scheduler control settings window
		05/31/10	fjt		Added trail layout

********************************************************************************************************/

$insert SRP_APP_INSERTS
$insert SRP_EVENT_SETUP

Declare function MemberOf

Equ Schedule$ to "WO_MASTER_SCHEDULER.OLE_SCHEDULE"

Set_Property(Schedule$, "OLE.Redraw", No$)

Gosub Init
GoSub Preferences_Definition
GoSub Base_Settings
GoSub Layout
GoSub Dropdowns

Set_Property(Schedule$, "OLE.Redraw", Yes$)

Return


!----- PROCESS ROUTINES ---------------------------------------------------------------------------------


Init:
	If Assigned(Param1) else Param1 = ""

	Dock   = Yes$
	Date   = Param1<2>
	Button = Yes$
	SchSvr = ""
return


Preferences_Definition:
	Config = Xlate("CONFIG", "MSC_CONFIGURATION", "", "X")

    MultiLine = Yes$
    Word_Wrap = No$
return



Base_Settings:
 	Set_Property(Schedule$, "OLE.View",				"MultiDayHorz")				;// Landscape mode
 	Set_Property(Schedule$, "OLE.ScheduleOnLeft",	Yes$)
 	Set_Property(Schedule$, "OLE.DateHeaderFormat", "DDDD  -  mmm DD, YYYY")
	Set_Property(Schedule$, "OLE.EntityMinSize",	Config<01>)             	;// Height of the row for this horiz view mode
	Set_Property(Schedule$, "OLE.ShowCalendar",		No$)
	Set_Property(Schedule$, "OLE.ShowTree",			No$)
	* Set_Property(Schedule$, "OLE.PreventConflict",	No$)
	Set_Property(Schedule$, "OLE.Interval",			60)							;// Number of minutes per interval
	Set_Property(Schedule$, "OLE.IntervalSize",		10)							;// Space (width) for each time increment (in pixels)
	Set_Property(Schedule$, "OLE.ConflictColor",	"Crimson")
	Set_Property(Schedule$, "OLE.TimeRange",		0 :@FM: 24 :@FM: 4)		;// <3> is hour display increment
	Set_Property(Schedule$, "OLE.RightTimeBar",		Yes$)
	Set_Property(Schedule$, "OLE.AllowLeadTime",	No$)
	Set_Property(Schedule$, "OLE.AllowTrailTime",	No$)
	
 	Set_Property(Schedule$, "OLE.Date", Date()-1)
	
	Fonts = ""
	Fonts<1> = Config<05,1> :@SVM: Config<05,2>
	Fonts<2> = Config<06,1> :@SVM: Config<06,2>
	Fonts<3> = "Tahoma" :@SVM: 16				;// Entity (reactor) Header Name
	Fonts<4> = "Tahoma" :@SVM: 09				;// Entity (reactor) description
	Fonts<5> = Config<09,1> :@SVM: Config<09,2>
	Set_Property(Schedule$, "OLE.ScheduleFonts", Fonts)
return


Layout:
	// Schedule Layout
	Layout = Get_Property(Schedule$, "OLE.Layout")
   
	// Header font
	Font = Layout<2,5>
	Font<0,0,1> = "Lucida Console"
	Font<0,0,2> = 10
	Layout<2,5> = Font

	// Description font
	Font = Layout<3,5>
	Font<0,0,1> = "Lucida Console"
	Font<0,0,2> = 9
	Layout<3,5> = Font
   
    NewLayout      	= Layout<2> :@FM: Layout<3>
    NewLayout<1,02> = 0 :@SVM:  0 :@SVM: -1 :@SVM: 16
    NewLayout<1,06> = "Left"
    NewLayout<1,07> = "Center"
    NewLayout<2,02> = 0 :@SVM: 17 :@SVM: -1 :@SVM: -1
    NewLayout<2,06> = "Left"
    NewLayout<2,07> = "Center"
 	NewLayout<2,08> = MultiLine
 	NewLayout<2,10> = Word_Wrap
 	Set_Property(Schedule$, "OLE.Layout", NewLayout)	
	
	// Trail Layout; this is the stoppage time
 	Layout = ""
 	Layout<1,1> = "APPTDATA"						;// We want to show appointment data
 	Layout<1,2> = 0:@SVM:0:@SVM:-1:@SVM:-1			;// Fill up the entire lead time area
 	Layout<1,3> = "TRAIL"							;// Value: Show the name
 	Layout<1,4> = "'Pace Adjustment'"				;// Settings: Format (show total minutes)
 	Layout<1,5> = ""								;// Default Font: Tahoma, 8 pt.
 	Layout<1,6> = "Center"							;// Center it
 	Layout<1,7> = "Center"							;// Center it vertically too
 	Layout<1,8> = MultiLine							;// Multi-lined always
 	Layout<1,9> = ""								;// No background effect
 	Layout<1,10> = No$								;// Word wrap off
 	Set_Property(Schedule$, "OLE.TrailLayout", Layout)
return


Dropdowns:
	// Filters
	List = "<none>,by Reactor Type,by Current Dopant,by Group,Escalated Reactors,Events Only"
	Convert "," to @FM in List
	Set_Property(@Window:".COB_FILTER", "LIST", List)
	Set_Property(@Window:".COB_FILTER", "TEXT", List<1>)
	
	// Options
	Begin Case
		* Case MemberOf(@USER4, 'MASTER_SCHED') ; List = "New,Send Notifs,Preview,Print,Import"
		Case MemberOf(@USER4, 'OI_ADMIN')	  ; List = "New,Audit,Preview,Print,Import"
		Case MemberOf(@USER4, 'TESTING')	  ; List = "New,Preview,Print,Import"
		Case MemberOf(@USER4, 'MASTER_SCHED') ; List = "New,Preview,Print"
		Case Otherwise$						  ; List = "Preview,Print"
	End Case
	Convert "," to @FM in List
	Set_Property(@Window:".COB_OPTION", "LIST", List)
	Set_Property(@Window:".COB_OPTION", "TEXT", List<1>)
	
	// Search
	List = "WO,PSN"
	Convert "," to @FM in List
	Set_Property(@Window:".COB_FIELD", "LIST", List)
	Set_Property(@Window:".COB_FIELD", "TEXT", List<1>)
return
