Casting and Costume Management Application
Check-in [7a2df02d9f]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Full implementation of backstage application.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7a2df02d9f03ffeb6b676df94aa146a58a075e3c
User & Date: gerald 2014-12-18 07:28:34
Context
2014-12-20
17:12
Coalese of performer records now working to eliminate duplicates. check-in: a27311d251 user: gerald tags: trunk
2014-12-18
07:28
Full implementation of backstage application. check-in: 7a2df02d9f user: gerald tags: trunk
2014-12-17
07:34
Initial working Backstage application. check-in: 378f4f98a4 user: gerald tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to MakeBackstageApp.tcl.

2
3
4
5
6
7
8

9
10
11
12
13
14
15
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Tcl

set ofd [open BackStage.tcl w]
set fileList {

    src/Functions/ClearGui.tcl
    src/Functions/InitializeSystem.tcl
    src/Functions/isAdult.tcl
    src/Functions/PerformerDetails.tcl
    src/Functions/PopulatePerformers.tcl
    src/Functions/SetCb.tcl
    src/Functions/SetPerformer.tcl







>







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Tcl

set ofd [open BackStage.tcl w]
set fileList {
    src/Functions/BackstageClientRoutines.tcl
    src/Functions/ClearGui.tcl
    src/Functions/InitializeSystem.tcl
    src/Functions/isAdult.tcl
    src/Functions/PerformerDetails.tcl
    src/Functions/PopulatePerformers.tcl
    src/Functions/SetCb.tcl
    src/Functions/SetPerformer.tcl

Added src/Functions/BackstageClientRoutines.tcl.





















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

proc ReloadDatabaseFromServer {} {
    variable DisplayConnectionStatusGui
    variable systemInfo

    set saveInfo [::log::lvIsSuppressed  info]
    set savedebug [::log::lvIsSuppressed debug]
    #::log::lvSuppress info 0
    #::log::lvSuppress debug 0
    ::log::log debug "[string repeat { } [info level]][info level 0]"

    set DisplayConnectionStatusGui(statusMessage) {}
    set DisplayConnectionStatusGui(status) 0
    DisplayConnectionStatus
    if {![GetServerAddress]} {
        return
    }
    ::log::log info "Downloading database ..."
    PullDatabase
    UndisplayConnectionStatus
    PopulatePerformers
    PopulatePerformerDetails PerformerDetails
    PopulateCostumePreview
    ::log::lvSuppress info $saveInfo
    ::log::lvSuppress debug $savedebug
    return
}

proc SendDatabaseToServer {} {
    variable DisplayConnectionStatusGui
    variable systemInfo

    set saveInfo [::log::lvIsSuppressed  info]
    set savedebug [::log::lvIsSuppressed debug]
    #::log::lvSuppress info 0
    #::log::lvSuppress debug 0
    ::log::log debug "[string repeat { } [info level]][info level 0]"

    set DisplayConnectionStatusGui(statusMessage) {}
    set DisplayConnectionStatusGui(status) 0
    DisplayConnectionStatus
    if {![GetServerAddress]} {
        return
    }
    ::log::log info "Sending performer notes..."
    SendPerfomerNotes
    UndisplayConnectionStatus
    ::log::lvSuppress info $saveInfo
    ::log::lvSuppress debug $savedebug

    return;
}

proc SendPerfomerNotes {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable serverInfo
    variable systemInfo

    set dataList [list]
    db eval {
        select hysellid, notes
            from Performers
    } dbArr {
        lappend dataList [list $dbArr(hysellid) $dbArr(notes)]
    }
    set dataLen [llength $dataList]
    set cmdRecord [format {UPDATE BACKSTAGEDATA %d\n%s} $dataLen $dataList]


    ##
    ## Open the socket
    ##
    set socket [socket $serverInfo(host) $serverInfo(port)]
    fconfigure $socket -translation lf -blocking no

    ##
    ## Send the update
    ##
    ::log::log info "\t Sending {$cmdRecord}"
    puts $socket $cmdRecord
    puts -nonewline $socket $dataRecord
    flush $socket

    ##
    ## Close the socket
    ##
    close $socket

    return
}

Changes to src/Functions/ClientRoutines.tcl.

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    }
    PullDatabase
    UndisplayConnectionStatus
    db close
    return
}

proc ReloadDatabaseFromServer {} {
    set saveInfo [::log::lvSuppress info]
    set savedebug [::log::lvSuppress debug]
    ::log::lvSuppress info 0
    ::log::lvSuppress debug 0
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable DisplayConnectionStatusGui
    variable systemInfo

    set DisplayConnectionStatusGui(statusMessage) {}
    set DisplayConnectionStatusGui(status) 0
    DisplayConnectionStatus
    if {![GetServerAddress]} {
        return
    }
    ::log::log info "Checking for file {$systemInfo(DatabaseFile)}"
    PullDatabase
    UndisplayConnectionStatus
    PopulatePerformers
    PopulatePerformerDetails PerformerDetails
    PopulateCostumePreview
    ::log::lvSuppress info $saveInfo
    ::log::lvSuppress debug $savedebug
    return
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : udpEventHandler
#







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







75
76
77
78
79
80
81


























82
83
84
85
86
87
88
    }
    PullDatabase
    UndisplayConnectionStatus
    db close
    return
}



























###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : udpEventHandler
#

Changes to src/Functions/ServerFunctions.tcl.

171
172
173
174
175
176
177
178


179
180
181
182
183
184
185
...
401
402
403
404
405
406
407
















408
409
410
411
412
413
414
                    set dataLength [lindex $clientRequest 2]
                    set data [read $channel $dataLength]
                    ::log::log info "\t\t Data is {$data}"
                    switch -exact -- [lindex $clientRequest 3] {
                        AUDITIONDATA {
                            ProcessAuditionUpdate $data
                        }
                        BACKSTAGEDATA -


                        default {
                            ##
                            ## Not supported at this time, so do nothing
                            ##
                        }
                    }
                    db eval {
................................................................................
    }
    if {[dict exists $dataDict Castings]} {
        ::log::log info "Processing Castings"
        foreach auditionRecord [dict get $dataDict Castings] {
            AddAudition {*}$auditionRecord
        }
    }

















    return;
}


###########################################################################
#







|
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
...
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
                    set dataLength [lindex $clientRequest 2]
                    set data [read $channel $dataLength]
                    ::log::log info "\t\t Data is {$data}"
                    switch -exact -- [lindex $clientRequest 3] {
                        AUDITIONDATA {
                            ProcessAuditionUpdate $data
                        }
                        BACKSTAGEDATA {
                            ProcessNotesUpdate $data
                        }
                        default {
                            ##
                            ## Not supported at this time, so do nothing
                            ##
                        }
                    }
                    db eval {
................................................................................
    }
    if {[dict exists $dataDict Castings]} {
        ::log::log info "Processing Castings"
        foreach auditionRecord [dict get $dataDict Castings] {
            AddAudition {*}$auditionRecord
        }
    }

    return;
}

proc ProcessNotesUpdate {dataList} {
    set result {}

    ::log::log info "Processing Performer Notes Update"
    foreach performerRecord $dataList {
        lassign $performerRecord hysellId notes
        db eval {
            update Performers
                set Notes = $notes
                where HysellId = $hysellId
        }
    }

    return;
}


###########################################################################
#

Changes to src/Guis/BuildBackStageMenu.tcl.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        -menu $menuWidget.file
    menu $menuWidget.file
    $menuWidget.file add command \
        -label {Download from Server} \
        -command ReloadDatabaseFromServer
    $menuWidget.file add command \
        -label {Upload to Server} \
        -state disabled \
        -command SendDatabaseToServer
    $menuWidget.file add separator
    $menuWidget.file add command \
        -label {Exit} \
        -underline 1 \
        -command [list after 1 ExitApplication]








|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        -menu $menuWidget.file
    menu $menuWidget.file
    $menuWidget.file add command \
        -label {Download from Server} \
        -command ReloadDatabaseFromServer
    $menuWidget.file add command \
        -label {Upload to Server} \
        -state normal \
        -command SendDatabaseToServer
    $menuWidget.file add separator
    $menuWidget.file add command \
        -label {Exit} \
        -underline 1 \
        -command [list after 1 ExitApplication]

Changes to src/Guis/CreatePerformerDetailGui.tcl.

56
57
58
59
60
61
62

63
64
65
66
67
68





69
70
71
72
73
74
75
76
77
..
79
80
81
82
83
84
85





86
87
88

89
90
91
92
93
94
95
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreatePerformerDetailGui {w arrayName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable PerformerColList

    variable systemInfo

    foreach col $PerformerColList {
        if {$col in {HysellId Active Report}} {
            continue
        }





        ::ttk::label $w.lbl_$col -text [::msgcat::mc $col]
        ::ttk::entry $w.ent_$col -textvariable ${arrayName}($col)
    }
    $w.ent_BirthDate configure \
        -validate focusout \
        -validatecommand [list ValidateDate $arrayName %s] \
        -invalidcommand [list InvalidDate %W]
    set row 1
    set col 0
................................................................................
    grid configure $w.top -sticky ew -columnspan 8
    set item HysellId
    ::ttk::label $w.top.lbl_$item -text [::msgcat::mc $item]
    ::ttk::entry $w.top.ent_$item -textvariable ${arrayName}($item) -state readonly
    grid configure $w.top.lbl_$item -row $row -column [incr col] -sticky ew
    grid configure $w.top.ent_$item -row $row -column [incr col] -sticky ew
    foreach item {Active Report} {





        ttk::checkbutton $w.top.cb_$item \
            -onvalue {Y} \
            -offvalue {N} \

            -text [::msgcat::mc $item] \
            -variable ${arrayName}($item)
        grid configure $w.top.cb_$item -row $row -column [incr col] -sticky ew
    }
    grid columnconfigure $w.top 5 -weight 1

    if {$systemInfo(isAndroid)} {







>






>
>
>
>
>

|







 







>
>
>
>
>



>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
..
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreatePerformerDetailGui {w arrayName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable PerformerColList
    variable PerformerReadOnly
    variable systemInfo

    foreach col $PerformerColList {
        if {$col in {HysellId Active Report}} {
            continue
        }
        if {$col in $PerformerReadOnly} {
            set state readonly
        } else {
            set state normal
        }
        ::ttk::label $w.lbl_$col -text [::msgcat::mc $col]
        ::ttk::entry $w.ent_$col -textvariable ${arrayName}($col) -state $state
    }
    $w.ent_BirthDate configure \
        -validate focusout \
        -validatecommand [list ValidateDate $arrayName %s] \
        -invalidcommand [list InvalidDate %W]
    set row 1
    set col 0
................................................................................
    grid configure $w.top -sticky ew -columnspan 8
    set item HysellId
    ::ttk::label $w.top.lbl_$item -text [::msgcat::mc $item]
    ::ttk::entry $w.top.ent_$item -textvariable ${arrayName}($item) -state readonly
    grid configure $w.top.lbl_$item -row $row -column [incr col] -sticky ew
    grid configure $w.top.ent_$item -row $row -column [incr col] -sticky ew
    foreach item {Active Report} {
        if {$item in $PerformerReadOnly} {
            set state disabled
        } else {
            set state normal
        }
        ttk::checkbutton $w.top.cb_$item \
            -onvalue {Y} \
            -offvalue {N} \
            -state $state \
            -text [::msgcat::mc $item] \
            -variable ${arrayName}($item)
        grid configure $w.top.cb_$item -row $row -column [incr col] -sticky ew
    }
    grid columnconfigure $w.top 5 -weight 1

    if {$systemInfo(isAndroid)} {

Changes to src/Main.tcl.

53
54
55
56
57
58
59

60
61
62
63
64
65
66
...
149
150
151
152
153
154
155
156
set systemInfo(udpPresent) $udpPresent
set systemInfo(isAndroid) no

set baseDir [file dirname [info script]]

set CopyFamilyInfo(fieldList) {EmailAddress Address City State ZipCode ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2}
set PerformerColList {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report Notes fnsort lnsort}

set CostumeColList {ShowId charctercode auditionnumber FirstName LastName Costume1 Costume2 Costume3 Costume4 Notes}
set ReportColDisplayList {ReportName Description ReportType InitalFile PrependShowId Title}
set ReportColList {ReportName ReportType ReportSql UserDefined ReportColumns Restrictions InitalFile PrependShowId Title Description}
set CostumePreviewColList {HysellId ShowId ShowDescription CharacterClass CharacterCode CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}
set CostumePreviewDisplayList {ShowDescription CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}

set SetPerformer 0
................................................................................
set MassUpdate(Enabled) 0
set MassUpdate(SelectionList) {}

PopulatePerformerDetails PerformerDetails

SaveSystemInfo

::log::lvSuppress info 0







>







 







|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
...
150
151
152
153
154
155
156
157
set systemInfo(udpPresent) $udpPresent
set systemInfo(isAndroid) no

set baseDir [file dirname [info script]]

set CopyFamilyInfo(fieldList) {EmailAddress Address City State ZipCode ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2}
set PerformerColList {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report Notes fnsort lnsort}
set PerformerReadOnly {HysellId}
set CostumeColList {ShowId charctercode auditionnumber FirstName LastName Costume1 Costume2 Costume3 Costume4 Notes}
set ReportColDisplayList {ReportName Description ReportType InitalFile PrependShowId Title}
set ReportColList {ReportName ReportType ReportSql UserDefined ReportColumns Restrictions InitalFile PrependShowId Title Description}
set CostumePreviewColList {HysellId ShowId ShowDescription CharacterClass CharacterCode CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}
set CostumePreviewDisplayList {ShowDescription CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}

set SetPerformer 0
................................................................................
set MassUpdate(Enabled) 0
set MassUpdate(SelectionList) {}

PopulatePerformerDetails PerformerDetails

SaveSystemInfo

#::log::lvSuppress info 0

Changes to src/PreAuditionMain.tcl.

62
63
64
65
66
67
68

69
70
71
72
73
74
75
wm withdraw .
set baseDir [file dirname [info script]]



set CopyFamilyInfo(fieldList) {EmailAddress Address City State ZipCode ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2}
set PerformerColList {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report Notes fnsort lnsort}

set SetPerformer 0
set SetPerformerFirstTime 1

array set AuditionEntryGui {
    EnterAuditionNumber Y
    ExistingDancer Y
    InShow N







>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
wm withdraw .
set baseDir [file dirname [info script]]



set CopyFamilyInfo(fieldList) {EmailAddress Address City State ZipCode ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2}
set PerformerColList {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report Notes fnsort lnsort}
set PerformerReadOnly {HysellId}
set SetPerformer 0
set SetPerformerFirstTime 1

array set AuditionEntryGui {
    EnterAuditionNumber Y
    ExistingDancer Y
    InShow N

Changes to src/PreBackStageMain.tcl.

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
..
68
69
70
71
72
73
74

75
76
77
78
79
80
81
package require struct::set

catch {
    package require tkconclient
    tkconclient::start 12345
}

::log::lvSuppress info 0

if {[catch {package require udp}]} {
    set udpPresent yes
} else {
    set udpPresent no
}

................................................................................
#::log::lvSuppress debug 0
#::log::lvSuppress info 0
wm withdraw .
set baseDir [file dirname [info script]]

set CopyFamilyInfo(fieldList) {EmailAddress Address City State ZipCode ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2}
set PerformerColList {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report Notes fnsort lnsort}

set CostumePreviewColList {HysellId ShowId ShowDescription CharacterClass CharacterCode CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}
set CostumePreviewDisplayList {ShowDescription CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}

set SetPerformer 0
set SetPerformerFirstTime 1

set systemInfo(DatabaseFile) ~/Backstage.db







|







 







>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
..
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package require struct::set

catch {
    package require tkconclient
    tkconclient::start 12345
}

#::log::lvSuppress info 0

if {[catch {package require udp}]} {
    set udpPresent yes
} else {
    set udpPresent no
}

................................................................................
#::log::lvSuppress debug 0
#::log::lvSuppress info 0
wm withdraw .
set baseDir [file dirname [info script]]

set CopyFamilyInfo(fieldList) {EmailAddress Address City State ZipCode ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2}
set PerformerColList {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report Notes fnsort lnsort}
set PerformerReadOnly {HysellId FirstName LastName BirthDate EmailAddress Address City State ZipCode School DancingSchool ParentName ParentLast PhoneNumber MobileNumber  ParentName2 ParentLast2 PhoneNumber2 MobileNumber2 Active Report fnsort lnsort}
set CostumePreviewColList {HysellId ShowId ShowDescription CharacterClass CharacterCode CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}
set CostumePreviewDisplayList {ShowDescription CharacterDescription Costume1 Costume2 Costume3 Costume4 CostumeNote}

set SetPerformer 0
set SetPerformerFirstTime 1

set systemInfo(DatabaseFile) ~/Backstage.db