Casting and Costume Management Application
Check-in [984e364058]
Not logged in

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

Overview
Comment:Added Audition Entry Client application.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 984e3640587d9b6b8f0efdfce9bc439ad1473f07
User & Date: gerald 2014-07-01 03:01:33.977
Context
2014-12-08
18:24
Add support for multiple types of clients. check-in: cdb54e1e07 user: gerald tags: trunk
2014-07-01
03:01
Added Audition Entry Client application. check-in: 984e364058 user: gerald tags: trunk
2013-09-18
20:07
Fixed save/cancel focus issue. check-in: e3e7440517 user: gerald tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Added MakeAuditionApp.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
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Tcl

set ofd [open AuditionApp.tcl w]
set fileList {
    src/PreAuditionMain.tcl
    src/Functions/ClearGui.tcl
    src/Functions/CopyFamilyInfo.tcl
    src/Functions/DisplayAuditionEntryGui.tcl
    src/Functions/InitializeSystem.tcl
    src/Functions/isAdult.tcl
    src/Functions/PerformerDetails.tcl
    src/Functions/SetCb.tcl
    src/Functions/SetPerformer.tcl
    src/Functions/ClientRoutines.tcl
    src/Guis/AuditionEntryGui.tcl
    src/Guis/CopyFamilyInfoGui.tcl
    src/Guis/ClientRoutineGuis.tcl
    src/Guis/CreatePerformerDetailGui.tcl
    src/Guis/TkError.tcl
}

foreach file [glob src/msgcat/*.msg] {
    lappend fileList $file
}

lappend fileList {src/AuditionMain.tcl}


foreach file $fileList {
    set ifd [open $file r]
    fcopy $ifd $ofd
    close $ifd
    puts $ofd {}
}
close $ofd
Added src/AuditionMain.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

proc SortAuditions {args} {
    return;
}

proc SortPerformers {args} {
    return;
}

proc SortShowInfo {args} {
    return;
}

proc SetAuditionEntryTitle {args} {
    variable windows
    variable systemInfo

    if {![string equal $systemInfo(ShowSelection) {}]} {
        set w $windows(AuditionEntryGui)
        set showName [lindex [db eval {select ShowDescription from Show where ShowID = $systemInfo(ShowSelection)}] 0]
        wm title $w "Ballet Hysell Audtion Entry Screen -- $showName"
    }
    return;
}

SetDefaultContext
set systemInfo(Mode) AuditionEntryOnly
set systemInfo(EnterAuditionNumber) yes

InitializeSystem no
db function isAdult isAdult

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

SaveSystemInfo

DisplayAuditionEntryGui

SetAuditionEntryTitle
trace add variable systemInfo(ShowSelection) write SetAuditionEntryTitle

wm withdraw .
Changes to src/Functions/ClearGui.tcl.
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ClearGui {w} {
    ::log::log debug [info level 0]
    foreach child [winfo children $w] {
        set childList [winfo children $child]
        if {[llength $childList]} {
            ClearGui $child
        } elseif {(![catch {$child cget -state} state] && ![string equal $state readonly]) &&
                  (![catch {$child cget -textvariable} widgetVar] ||
                  ![catch {$child cget -variable} widgetVar] ||







|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ClearGui {w} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    foreach child [winfo children $w] {
        set childList [winfo children $child]
        if {[llength $childList]} {
            ClearGui $child
        } elseif {(![catch {$child cget -state} state] && ![string equal $state readonly]) &&
                  (![catch {$child cget -textvariable} widgetVar] ||
                  ![catch {$child cget -variable} widgetVar] ||
Added src/Functions/ClientRoutines.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : CreateClientDb
#
# Description : Create the client database.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreateClientDb {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"

    ##
    ## Create the Show table
    ##
    db eval {
        CREATE TABLE Show (
            ShowID              TEXT,
            ShowDescription     TEXT,
            ShowClass           TEXT
        )
    }

    ##
    ## Create the Performers table
    ##
    db eval {
        CREATE TABLE Performers (
            HysellId        INTEGER,
            LastName        TEXT,
            FirstName       TEXT,
            Birthdate       DATE,
            Address         TEXT,
            City            TEXT,
            State           TEXT,
            ZipCode         TEXT,
            ParentName      TEXT,
            ParentLast      TEXT,
            PhoneNumber     TEXT,
            MobileNumber    TEXT,
            EmailAddress    TEXT,
            ParentName2     TEXT,
            ParentLast2     TEXT,
            PhoneNumber2    TEXT,
            MobileNumber2   TEXT,
            EmailAddress2   TEXT,
            School          TEXT,
            DancingSchool   TEXT,
            Notes           TEXT,
            Active          BOOLEAN,
            Report          BOOLEAN
        )
    }

    ##
    ## Create the Casting table -- but we add a column to flag auditions that
    ## need to go to the server.
    ##
    db eval {
        CREATE TABLE Casting (
            ShowID              TEXT,
            HysellId            TEXT,
            auditionnumber      INTEGER,
            inShow              BOOLEAN,
            changed             BOOLEAN
        )
    }

    return
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : GetDatabaseFromServer
#
# Description : Get the database from the server
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GetDatabaseFromServer {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable DisplayConnectionStatusGui
    variable systemInfo

    set DisplayConnectionStatusGui(statusMessage) {}
    set DisplayConnectionStatusGui(status) 0
    DisplayConnectionStatus
    set DisplayConnectionStatusGui(statusMessage) {Locating Server...}
    GetServerAddress
    ::log::log info "Checking for file {$systemInfo(DatabaseFile)}"
    if {![file exists $systemInfo(DatabaseFile)]} {
        sqlite3 db $systemInfo(DatabaseFile)
        CreateClientDb
    } else {
        sqlite3 db $systemInfo(DatabaseFile)
    }
    set DisplayConnectionStatusGui(statusMessage) {Getting initial data from server...}
    PullDatabase
    UndisplayConnectionStatus
    db close
    return
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : SynchronizeWithServer
#
# Description : Synchronize the database with the server.  First we push
#               the changes.  Then we pull the changes.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SynchronizeWithServer {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable DisplayConnectionStatusGui

    set DisplayConnectionStatusGui(statusMessage) {}
    set DisplayConnectionStatusGui(status) 0
    DisplayConnectionStatus
    set DisplayConnectionStatusGui(statusMessage) {Locating Server...}
    GetServerAddress
    set DisplayConnectionStatusGui(statusMessage) {Sending changes to server...}
    PushDatabase
    set DisplayConnectionStatusGui(statusMessage) {Refreshing data from server...}
    PullDatabase
    UndisplayConnectionStatus
    return
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : udpEventHandler
#
# Description : Handle a UDP message from the server.
#
# Arguments :
#   sock - the socket we were listening on
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc udpEventHandler {sock} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable serverInfo

    set pkt [read $sock]
    ::log::log info "\tRead: {$pkt}"
    lassign $pkt cmd systemInfo(ShowSelection) serverInfo(host) serverInfo(port)
    close $sock
    return
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : GetServerAddress
#
# Description : Get the server address.  We need to do this since it may have
#               changed since the last time we looked.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GetServerAddress {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable serverInfo
    variable DisplayConnectionStatusGui

    set DisplayConnectionStatusGui(statusMessage) {Searching for server...}
    update idletasks
    set serverInfo(host) {}
    set serverInfo(port) {}

    set group 224.5.1.21
    set port  7771

    set socket [udp_open $port]
    fconfigure $socket -mcastadd $group
    fileevent $socket readable [list udpEventHandler $socket]
    vwait serverInfo(host)
    if {![info exists systemInfo(clientId)] || [string equal $systemInfo(clientId) {}]} {
        RegisterClient
    }
}



###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : RegisterClient
#
# Description : Get the server address.  We need to do this since it may have
#               changed since the last time we looked.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc RegisterClient {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable serverInfo
    variable DisplayConnectionStatusGui

    set DisplayConnectionStatusGui(statusMessage) {Registering Client...}
    update idletasks

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

    ##
    ## Send the update
    ##
    set dataPacket [list REGISTER $systemInfo(clientName)]
    ::log::log info "\t Sending {$dataPacket}"
    puts $socket $dataPacket
    flush $socket

    ##
    ## Get the our client id back
    ##
    set response {}
    set status [gets $socket response]
    ::log::log info "\t Received {$response} with status {$status}"
    if {$status > 0} {
        lassign $response cmd systemInfo(clientId)
    } else {
        tk_messageBox \
            -default ok \
            -icon error \
            -message {Server connection failed.} \
            -parent . \
            -title {Applicaiton Error} \
            -type ok
        after 1 {destroy .}
    }

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


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : PushDatabase
#
# Description : Push the changes to the server.  This will be all the
#               performers with a negative performer id, along with there
#               audition information, and all the audition information
#               marked as needing to be pushed.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PushDatabase {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable serverInfo
    variable systemInfo

    ##
    ## Start with an empty dictionary
    ##
    set dataRecord [dict create]

    ##
    ## Get all of the new performers and their audition information
    ##
    set performerRecords {}
    set performerCols {
        HysellId FirstName LastName Birthdate ParentName
        ParentLast PhoneNumber MobileNumber EmailAddress
        ParentName2 ParentLast2 PhoneNumber2 MobileNumber2
        EmailAddress2 Address City State ZipCode School
        DancingSchool Active Report Notes
    }
    db eval {
        select  HysellId, FirstName, LastName, Birthdate, ParentName,
                ParentLast, PhoneNumber, MobileNumber, EmailAddress,
                ParentName2, ParentLast2, PhoneNumber2, MobileNumber2,
                EmailAddress2, Address, City, State, ZipCode, School,
                DancingSchool, Active, Report, Notes
            from Performers
            where HysellId  < 0
    } dbArr {
        parray dbArr
        set performerDict [dict create]
        foreach item $performerCols {
            dict set performerDict $item $dbArr($item)
        }
        lappend performerRecords $performerDict
    }
    foreach performerDict $performerRecords {
        set HysellId [dict get $performerDict HysellId]
        ##
        ## Get the audition info
        ##
        ::log::log info "\t Looking for HysellId = {$HysellId}"
        db eval {
            select ShowId, auditionnumber, changed
                from Casting
                where HysellId = $HysellId
        } dbArr {
            parray dbArr
            dict set performerDict AuditionNumber $dbArr(auditionnumber)
            dict set performerDict ShowId $dbArr(ShowID)
        }
        dict lappend dataRecord Performers $performerDict
        ::log::log info "\t Adding Performer Record {$performerDict}"
    }

    ##
    ## Get all of the Casting that was updated
    ##
    db eval {
        select ShowId, HysellId, auditionnumber
            from Casting
            where HysellId > 0
              and changed = 'Y'
    } dbArr {
        set auditionRecord [list $dbArr(ShowID) $dbArr(HysellId) $dbArr(auditionnumber)]
        dict lappend dataRecord Castings $auditionRecord
        ::log::log info "\t Adding Audition Record {$auditionRecord}"
    }

    ##
    ## Build the data record to send
    ##
    set cmdRecord [format {UPDATE %s %d} $systemInfo(clientId) [string length $dataRecord]]

    ##
    ## 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
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : PullDatabase
#
# Description : Pull the changes from the server.  This means we first clear
#               the current tables.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PullDatabase {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable serverInfo
    variable systemInfo

    ##
    ## Clear the show, performers and casting tables
    ##
    db eval {
        delete from Show
    }
    db eval {
        delete from Performers
    }
    db eval {
        delete from Casting
    }

    ##
    ## Request information from the server
    ##
    set cmdRecord [format {GET %s} $systemInfo(clientId)]

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

    ##
    ## Send the request
    ##
    ::log::log info "\t Sending {$cmdRecord}"
    puts $socket $cmdRecord
    flush $socket
    set response {}
    set status [gets $socket response]
    ::log::log info "\t Received {$response} with status {$status}"
    if {($status > 0) && [string equal [lindex $response 0] DATA]} {
        set length [lindex $response end]
        set dbDictionary [read -nonewline $socket]
        set lengthReceived [string length $dbDictionary]
        if {$length != $lengthReceived} {
            tk_messageBox \
                -default ok \
                -detail  "Received {$length} expected {$lengthReceived}." \
                -icon error \
                -message {Short message received.} \
                -parent . \
                -title {Applicaiton Error}
                -type ok
            after 1 {destroy .}
        }
    } else {
        tk_messageBox \
            -default ok \
            -icon error \
            -message {Server connection failed.} \
            -parent . \
            -title {Applicaiton Error} \
            -type ok
        after 1 {destroy .}
    }

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

    ##
    ## Populate the Show
    ##
    lassign [dict get $dbDictionary ShowInfo] ShowID ShowDescription ShowClass
    db eval {
        insert into Show (ShowID, ShowDescription, ShowClass)
        values ($ShowID, $ShowDescription, $ShowClass)
    }

    ##
    ## Populate the Performers
    ##
    foreach performerRecord [dict get $dbDictionary Performers] {
        lassign $performerRecord \
                HysellId FirstName LastName BirthDate ParentName ParentLast \
                PhoneNumber MobileNumber EmailAddress ParentName2 ParentLast2 \
                PhoneNumber2 MobileNumber2 EmailAddress2 Address City State \
                ZipCode School DancingSchool Active Report Notes
        db eval {
            insert into Performers (
                HysellId, FirstName, LastName, BirthDate, ParentName,
                ParentLast, PhoneNumber, MobileNumber, EmailAddress,
                ParentName2, ParentLast2, PhoneNumber2, MobileNumber2,
                EmailAddress2, Address, City, State, ZipCode, School,
                DancingSchool, Active, Report, Notes
            ) values (
                $HysellId, $FirstName, $LastName, $BirthDate, $ParentName,
                $ParentLast, $PhoneNumber, $MobileNumber, $EmailAddress,
                $ParentName2, $ParentLast2, $PhoneNumber2, $MobileNumber2,
                $EmailAddress2, $Address, $City, $State, $ZipCode, $School,
                $DancingSchool, $Active, $Report, $Notes
            )
        }
    }

    ##
    ## Populate the Casting
    ##
    foreach castingRecord [dict get $dbDictionary Casting] {
        lassign $castingRecord ShowId HysellId auditionnumber
        db eval {
            insert into Casting (ShowId,HysellId,auditionnumber,changed)
            values ($ShowId,$HysellId,$auditionnumber,'N')
        }
    }

    return
}
Changes to src/Functions/CopyFamilyInfo.tcl.
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Pre-requisite Conditions : CopyFamilyInfo must be populated with a list
#                            of fields names to copy.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CopyFamilyInfo {dataArrVar} {
    ::log::log debug [info level 0]

    upvar 1 $dataArrVar dataArr
    variable CopyFamilyInfo
    variable windows

    BuildCopyFamilyInfo
    set w $windows(CopyFamilyInfoGui)







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Pre-requisite Conditions : CopyFamilyInfo must be populated with a list
#                            of fields names to copy.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CopyFamilyInfo {dataArrVar} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"

    upvar 1 $dataArrVar dataArr
    variable CopyFamilyInfo
    variable windows

    BuildCopyFamilyInfo
    set w $windows(CopyFamilyInfoGui)
Changes to src/Functions/DisplayAuditionEntryGui.tcl.
52
53
54
55
56
57
58
59
60
61
62
63
64


65
66

67
68
69
70
71
72
73
#
# Pre-requisite Conditions : A show must have been selected in the Show tab.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayAuditionEntryGui {} {
    ::log::log debug [info level 0]
    variable windows
    variable AuditionEntryGui
    variable systemInfo

    BuildAuditionEntryGui


    set menuWidget $windows(Mainmenu).tools
    $menuWidget entryconfigure {Copy Family Information} -state disabled

    set windows(performerDetailedArrayName) AuditionEntryGui
    set w $windows(AuditionEntryGui)
    ClearGui $w
    db eval {
        select *
            from Show
            where ShowId = trim($systemInfo(ShowSelection))







|





>
>
|
|
>







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
#
# Pre-requisite Conditions : A show must have been selected in the Show tab.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayAuditionEntryGui {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable AuditionEntryGui
    variable systemInfo

    BuildAuditionEntryGui
    parray systemInfo
    if {![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        set menuWidget $windows(Mainmenu).tools
        $menuWidget entryconfigure {Copy Family Information} -state disabled
    }
    set windows(performerDetailedArrayName) AuditionEntryGui
    set w $windows(AuditionEntryGui)
    ClearGui $w
    db eval {
        select *
            from Show
            where ShowId = trim($systemInfo(ShowSelection))
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#
# Pre-requisite Conditions : A show must have been selected in the Show tab.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveAuditionEntry {} {
    ::log::log debug [info level 0]
    variable windows
    variable AuditionEntryGui
    variable PerformerDetails
    variable systemInfo

    if {[string equal $AuditionEntryGui(auditionnumber) {}] ||
        [string equal $AuditionEntryGui(FirstName) {}] ||







|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# Pre-requisite Conditions : A show must have been selected in the Show tab.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveAuditionEntry {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable AuditionEntryGui
    variable PerformerDetails
    variable systemInfo

    if {[string equal $AuditionEntryGui(auditionnumber) {}] ||
        [string equal $AuditionEntryGui(FirstName) {}] ||
139
140
141
142
143
144
145
146
147
148
149
150



151




















152
153
154
155
156
157
158
159
160
161
162
163



















164
165
166
167
168
169
170
        if {$dbArr(auditionNumberUsed)} {
            tk_messageBox \
                -default ok \
                -icon error \
                -message {Audition number already exists} \
                -parent $windows(AuditionEntryGui) \
                -title {Audition number already exists} \
                -type ok 
            return
        }
    }




    if {!$AuditionEntryGui(ExistingDancer)} {




















        ##
        ## Generate a Hysell ID
        ##
        db eval {
            select max(HysellId)+1 HysellId
                from Performers
        } dbArr {
            array set AuditionEntryGui [array get dbArr]
        }
        ##
        ## Create a bare Performer record
        ##



















        db eval {
            insert into Performers(HysellId) values ($AuditionEntryGui(HysellId))
        }
    }


    ##







|




>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












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







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
        if {$dbArr(auditionNumberUsed)} {
            tk_messageBox \
                -default ok \
                -icon error \
                -message {Audition number already exists} \
                -parent $windows(AuditionEntryGui) \
                -title {Audition number already exists} \
                -type ok
            return
        }
    }

    ##
    ## Verify Performer does not already have an Audition Number
    ##
    if {$AuditionEntryGui(ExistingDancer)} {
        db eval {
            select count(*) auditionNumberUsed
                from Casting
                where HysellId = $AuditionEntryGui(HysellId)
                  and ShowID = $AuditionEntryGui(ShowID)
        } dbArr {
            if {$dbArr(auditionNumberUsed)} {
                tk_messageBox \
                    -default ok \
                    -icon error \
                    -message {Performer already assigned an audition number} \
                    -parent $windows(AuditionEntryGui) \
                    -title {Performer already assigned an audition number} \
                    -type ok
                return
            }
        }
    }

    if {!$AuditionEntryGui(ExistingDancer) && ![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        ##
        ## Generate a Hysell ID
        ##
        db eval {
            select max(HysellId)+1 HysellId
                from Performers
        } dbArr {
            array set AuditionEntryGui [array get dbArr]
        }
        ##
        ## Create a bare Performer record
        ##
        db eval {
            insert into Performers(HysellId) values ($AuditionEntryGui(HysellId))
        }
    } elseif {!$AuditionEntryGui(ExistingDancer) && [string equal $systemInfo(Mode) AuditionEntryOnly]} {
        ##
        ## Generate a Hysell ID
        ##
        db eval {
            select min(HysellId)-1 HysellId
                from Performers
        } dbArr {
            array set AuditionEntryGui [array get dbArr]
        }
        ##
        ## Create a bare Performer record
        ##
        if {$AuditionEntryGui(HysellId) >= 0} {
            set AuditionEntryGui(HysellId) -1
        }
        db eval {
            insert into Performers(HysellId) values ($AuditionEntryGui(HysellId))
        }
    }


    ##
192
193
194
195
196
197
198

199
200







201
202
203
204
205
206
207
            $AuditionEntryGui(ShowID)
        )
    }

    if {!$AuditionEntryGui(ExistingDancer)} {
        set systemInfo(PerformerSelection) $AuditionEntryGui(HysellId)
    }

    SetPerformer {} {}
    RestoreContext








    DisplayAuditionEntryGui
}


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







>
|
|
>
>
>
>
>
>
>







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
            $AuditionEntryGui(ShowID)
        )
    }

    if {!$AuditionEntryGui(ExistingDancer)} {
        set systemInfo(PerformerSelection) $AuditionEntryGui(HysellId)
    }
    if {![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        SetPerformer {} {}
        RestoreContext
    } elseif {$AuditionEntryGui(ExistingDancer)}  {
        db eval {
            update Casting
                set changed = 'Y'
                where HysellId = $AuditionEntryGui(HysellId)
        }
    }

    DisplayAuditionEntryGui
}


###########################################################################
#
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GenerateAuditionNumber {} {
    ::log::log debug [info level 0]
    variable AuditionEntryGui
    variable systemInfo

    if {!$systemInfo(EnterAuditionNumber)} {
        db eval {
            select ifnull(max(auditionnumber),0)+1 auditionnumber
                from Casting







|







276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GenerateAuditionNumber {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable AuditionEntryGui
    variable systemInfo

    if {!$systemInfo(EnterAuditionNumber)} {
        db eval {
            select ifnull(max(auditionnumber),0)+1 auditionnumber
                from Casting
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CheckForPerformer {} {
    ::log::log debug [info level 0]
    variable AuditionEntryGui
    variable windows
    variable systemInfo
    variable PerformerDetails
    variable PerformerColList

    set w $windows(AuditionEntryGui)







|







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CheckForPerformer {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable AuditionEntryGui
    variable windows
    variable systemInfo
    variable PerformerDetails
    variable PerformerColList

    set w $windows(AuditionEntryGui)
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
                    -default yes \
                    -icon warning \
                    -message {An existing record was for a dancer was found.  Displaying the record. Selected "yes' to use it or "no" to create a new record.} \
                    -parent $w \
                    -title {Record Unexpectedly Found} \
                    -type yesnocancel ]
        if {[string equal $ans yes]} {
            set AuditionEntryGui(ExistingDancer) N
        } elseif {[string equal $ans no]} {
            foreach item $PerformerColList {
                switch -exact -- $item {
                    FirstName -
                    LastName {
                        ##
                        ## Do nothing







|







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
                    -default yes \
                    -icon warning \
                    -message {An existing record was for a dancer was found.  Displaying the record. Selected "yes' to use it or "no" to create a new record.} \
                    -parent $w \
                    -title {Record Unexpectedly Found} \
                    -type yesnocancel ]
        if {[string equal $ans yes]} {
            set AuditionEntryGui(ExistingDancer) Y
        } elseif {[string equal $ans no]} {
            foreach item $PerformerColList {
                switch -exact -- $item {
                    FirstName -
                    LastName {
                        ##
                        ## Do nothing
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc LoadPerformerForAudition {performer} {
    ::log::log debug [info level 0]
    variable AuditionEntryGui
    variable systemInfo
    variable PerformerDetails

    set AuditionEntryGui(HysellId) $performer
    GenerateAuditionNumber








|







502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc LoadPerformerForAudition {performer} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable AuditionEntryGui
    variable systemInfo
    variable PerformerDetails

    set AuditionEntryGui(HysellId) $performer
    GenerateAuditionNumber

Changes to src/Functions/DisplayCostumeEntryGui.tcl.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : A show must be selected.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayCostumeEntryGui {} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    if {![info exists systemInfo(ShowSelection)] || [string equal $systemInfo(ShowSelection) {}]} {
        tk_messageBox \
            -icon error \







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : A show must be selected.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayCostumeEntryGui {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    if {![info exists systemInfo(ShowSelection)] || [string equal $systemInfo(ShowSelection) {}]} {
        tk_messageBox \
            -icon error \
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Pre-requisite Conditions : A show must be selected.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateCostumeAssignments {} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    set l $windows(CostumeEntryCostumeTree)
    set r $windows(CostumeEntryPerformerTree)







|







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Pre-requisite Conditions : A show must be selected.
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateCostumeAssignments {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    set l $windows(CostumeEntryCostumeTree)
    set r $windows(CostumeEntryPerformerTree)
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CloseCostumeEntryGui {} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    grab release [grab current]
    wm withdraw $w







|







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CloseCostumeEntryGui {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    grab release [grab current]
    wm withdraw $w
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveCostumeAssignments {} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    set l $windows(CostumeEntryCostumeTree)
    set r $windows(CostumeEntryPerformerTree)







|







226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveCostumeAssignments {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    set l $windows(CostumeEntryCostumeTree)
    set r $windows(CostumeEntryPerformerTree)
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SelectPerformers {} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    set l $windows(CostumeEntryCostumeTree)
    set r $windows(CostumeEntryPerformerTree)







|







293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SelectPerformers {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeEntryGui
    variable systemInfo

    set w $windows(CostumeEntryGui)
    set l $windows(CostumeEntryCostumeTree)
    set r $windows(CostumeEntryPerformerTree)
Changes to src/Functions/ExitApplication.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ExitApplication {} {
    ::log::log debug [info level 0]
    SaveSystemInfo
    catch {db close}
    destroy .
}







|




53
54
55
56
57
58
59
60
61
62
63
64
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ExitApplication {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    SaveSystemInfo
    catch {db close}
    destroy .
}
Changes to src/Functions/ExportList.tcl.
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#                            ReportDefinitions table.
#
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ExportList {reportName} {
    ::log::log debug [info level 0]
    variable MassUpdate
    variable systemInfo

    set infoDict {}
    db eval {select * from ReportDefinitions where ReportName = $reportName} dataArray {
        foreach column $dataArray(*) {
            dict set infoDict $column $dataArray($column)







|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#                            ReportDefinitions table.
#
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ExportList {reportName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable MassUpdate
    variable systemInfo

    set infoDict {}
    db eval {select * from ReportDefinitions where ReportName = $reportName} dataArray {
        foreach column $dataArray(*) {
            dict set infoDict $column $dataArray($column)
Changes to src/Functions/InitializeSystem.tcl.
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
91
92

93
94
95
96
97

98


99

100
101
102
103
104
105
106
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc InitializeSystem {} {
    ::log::log debug [info level 0]
    variable systemInfo

    set savedInfoFound no

    foreach location {./ ~/} {
        if {[set savedInfoFound [LoadSystemInfo $location]]} {
            set systemInfo(path) $location
            break
        }
    }


    set types {
        {{Database Files}       {.db}}
    }
    if {!$savedInfoFound || ![file exists $systemInfo(DatabaseFile)]} {
        set savedInfoFound no
        set dbfn [tk_getOpenFile \
                    -defaultextension db \
                    -filetypes $types \
                    -initialdir [pwd] \
                    -multiple no \
                    -parent . \
                    -title {Choose Hysell Database} \
           ]
        if {[string equal $dbfn {}]} {
            destroy .
            return
        }
        set systemInfo(DatabaseFile) $dbfn
        SetDefaultContext
    } else {
        #parray systemInfo

    }

    set systemInfo(path) $location
    sqlite3 db $systemInfo(DatabaseFile)


    after 1 [list trace add variable systemInfo(ShowSelection) write PopulateAuditions]


    RestoreContext


    return;
}


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







|
|











>
|
|
|
<















|
|
>





>
|
>
>
|
>







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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc InitializeSystem {{restoreContext yes}} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo

    set savedInfoFound no

    foreach location {./ ~/} {
        if {[set savedInfoFound [LoadSystemInfo $location]]} {
            set systemInfo(path) $location
            break
        }
    }

    if {$restoreContext && (!$savedInfoFound || ![file exists $systemInfo(DatabaseFile)])} {
        set types {
            {{Database Files}       {.db}}
        }

        set savedInfoFound no
        set dbfn [tk_getOpenFile \
                    -defaultextension db \
                    -filetypes $types \
                    -initialdir [pwd] \
                    -multiple no \
                    -parent . \
                    -title {Choose Hysell Database} \
           ]
        if {[string equal $dbfn {}]} {
            destroy .
            return
        }
        set systemInfo(DatabaseFile) $dbfn
        SetDefaultContext
    } elseif {!$restoreContext && !$savedInfoFound}  {
        GetClientName
        GetDatabaseFromServer
    }

    set systemInfo(path) $location
    sqlite3 db $systemInfo(DatabaseFile)

    if {![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        after 1 [list trace add variable systemInfo(ShowSelection) write PopulateAuditions]
    }
    if {$restoreContext} {
        RestoreContext
    }

    return;
}


###########################################################################
#
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveSystemInfo {} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    #parray systemInfo
    set systemInfo(CurrentTab) [$windows(MainNotebook) select]
    set fn [file join $systemInfo(path) .HysellDbInfo]
    set ofd [open $fn w]
    puts $ofd [array get systemInfo]
    close $ofd

    return;
}








|




|
|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveSystemInfo {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    #parray systemInfo
    catch {set systemInfo(CurrentTab) [$windows(MainNotebook) select]}
    set fn [file join $systemInfo(path) $systemInfo(iniFile)]
    set ofd [open $fn w]
    puts $ofd [array get systemInfo]
    close $ofd

    return;
}

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc LoadSystemInfo {path} {
    ::log::log debug [info level 0]
    variable systemInfo

    set found no
    set fn [file join $path .HysellDbInfo]
    if {[file exists $fn]} {
        set found yes
        set ifd [open $fn r]
        array set systemInfo [read $ifd]
        close $ifd
    }








|



|







165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc LoadSystemInfo {path} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo

    set found no
    set fn [file join $path $systemInfo(iniFile)]
    if {[file exists $fn]} {
        set found yes
        set ifd [open $fn r]
        array set systemInfo [read $ifd]
        close $ifd
    }

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc RestoreContext {} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    PopulateShows
    PopulatePerformers
    PopulateCostumes
    PopulateAuditions







|







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc RestoreContext {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    PopulateShows
    PopulatePerformers
    PopulateCostumes
    PopulateAuditions
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SetDefaultContext {} {
    ::log::log debug [info level 0]
    variable systemInfo

    array set systemInfo {
        CurrentTab              {.nb.showTab}
        ShowSelection           {}
        ShowInfoSortColumn      {auditionnumber}
        ShowInfoSortDirection   {-increasing}







|







245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SetDefaultContext {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo

    array set systemInfo {
        CurrentTab              {.nb.showTab}
        ShowSelection           {}
        ShowInfoSortColumn      {auditionnumber}
        ShowInfoSortDirection   {-increasing}
263
264
265
266
267
268
269


270
271
272
        PerformerFilterOnActive 0
        PerformerFilterOnReport 0
        PerformerTracksShow     1
        PerformerTracksCostume  0
        PerformerSelection      {}
        EditName                0
        EnterAuditionNumber     Y


    }

}







>
>



268
269
270
271
272
273
274
275
276
277
278
279
        PerformerFilterOnActive 0
        PerformerFilterOnReport 0
        PerformerTracksShow     1
        PerformerTracksCostume  0
        PerformerSelection      {}
        EditName                0
        EnterAuditionNumber     Y
        Mode                    Standalone
        ClientId                {}
    }

}
Changes to src/Functions/MarkActive.tcl.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc MarkActive {value} {
    ::log::log debug [info level 0]
    variable MassUpdate
    variable systemInfo

    SelectCurrentView Set
    foreach id $MassUpdate(SelectionList) {
        db eval {
            update Performers







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc MarkActive {value} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable MassUpdate
    variable systemInfo

    SelectCurrentView Set
    foreach id $MassUpdate(SelectionList) {
        db eval {
            update Performers
Changes to src/Functions/MarkInReport.tcl.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc MarkInReport {value} {
    ::log::log debug [info level 0]
    variable MassUpdate
    variable systemInfo

    SelectCurrentView Set
    foreach id $MassUpdate(SelectionList) {
        db eval {
            update Performers







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc MarkInReport {value} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable MassUpdate
    variable systemInfo

    SelectCurrentView Set
    foreach id $MassUpdate(SelectionList) {
        db eval {
            update Performers
Changes to src/Functions/MarkInShow.tcl.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc MarkInShow {value} {
    ::log::log debug [info level 0]
    variable MassUpdate
    variable systemInfo

    SelectCurrentView Set
    foreach id $MassUpdate(SelectionList) {
        db eval {
            update Casting







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc MarkInShow {value} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable MassUpdate
    variable systemInfo

    SelectCurrentView Set
    foreach id $MassUpdate(SelectionList) {
        db eval {
            update Casting
Changes to src/Functions/PerformerDetails.tcl.
52
53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc UpdatePerformerDetails {} {
    ::log::log debug [info level 0]
    variable PerformerDetails


    db eval {
        update Performers
            set FirstName = trim($PerformerDetails(FirstName)),
                LastName = trim($PerformerDetails(LastName)),
                BirthDate = trim($PerformerDetails(BirthDate)),
                ParentName = trim($PerformerDetails(ParentName)),







|

>







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc UpdatePerformerDetails {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable PerformerDetails
    variable systemInfo

    db eval {
        update Performers
            set FirstName = trim($PerformerDetails(FirstName)),
                LastName = trim($PerformerDetails(LastName)),
                BirthDate = trim($PerformerDetails(BirthDate)),
                ParentName = trim($PerformerDetails(ParentName)),
82
83
84
85
86
87
88

89

90
91
92
93
94
95
96
                DancingSchool = trim($PerformerDetails(DancingSchool)),
                Active = trim($PerformerDetails(Active)),
                Report = trim($PerformerDetails(Report)),
                Notes = trim($PerformerDetails(Notes))
            where HysellId = trim($PerformerDetails(HysellId))
    }


    PopulatePerformers

}


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







>
|
>







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
                DancingSchool = trim($PerformerDetails(DancingSchool)),
                Active = trim($PerformerDetails(Active)),
                Report = trim($PerformerDetails(Report)),
                Notes = trim($PerformerDetails(Notes))
            where HysellId = trim($PerformerDetails(HysellId))
    }

    if {![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        PopulatePerformers
    }
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc AdjustPerformerDetailsButtons {args} {
    ::log::log debug [info level 0]
    variable windows
    variable PerformerDetails
    variable PerformerColList
    variable systemInfo

    set d $windows(MainPerformerTab).details








|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc AdjustPerformerDetailsButtons {args} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable PerformerDetails
    variable PerformerColList
    variable systemInfo

    set d $windows(MainPerformerTab).details

Changes to src/Functions/PopulateAuditions.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : A show must be selected
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateAuditions {args} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    set d $windows(MainAuditionTab).data
    $d delete [$d children {}]
    set allShows [string equal $systemInfo(ShowSelection) {}]
    set performer $systemInfo(PerformerSelection)







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : A show must be selected
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateAuditions {args} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    set d $windows(MainAuditionTab).data
    $d delete [$d children {}]
    set allShows [string equal $systemInfo(ShowSelection) {}]
    set performer $systemInfo(PerformerSelection)
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SortAuditions {OrderBy} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    set w $windows(MainAuditionTab).data
    set selection {}
    set performer $systemInfo(PerformerSelection)








|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SortAuditions {OrderBy} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    set w $windows(MainAuditionTab).data
    set selection {}
    set performer $systemInfo(PerformerSelection)

Changes to src/Functions/PopulateCostumes.tcl.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : A show must be selected
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateCostumes {} {
    ::log::log debug [info level 0]

    variable systemInfo
    variable windows
    variable CostumeColList

    set l $windows(MainCostumeTab).costumes.data
    set m $windows(MainCostumeTab).details.dynamicData







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : A show must be selected
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateCostumes {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"

    variable systemInfo
    variable windows
    variable CostumeColList

    set l $windows(MainCostumeTab).costumes.data
    set m $windows(MainCostumeTab).details.dynamicData
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayCostumeDetails {} {
    ::log::log debug [info level 0]
    variable CostumeDetails
    variable windows

    set l $windows(MainCostumeTab).costumes.data
    set m $windows(MainCostumeTab).details.dynamicData

    set item [$l selection]







|







145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayCostumeDetails {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable CostumeDetails
    variable windows

    set l $windows(MainCostumeTab).costumes.data
    set m $windows(MainCostumeTab).details.dynamicData

    set item [$l selection]
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc UpdateCostumeDetails {} {
    ::log::log debug [info level 0]
    variable CostumeDetails
    variable windows

    set l $windows(MainCostumeTab).costumes.data

    if {![string equal $CostumeDetails(audtion) {}]} {
        db eval {







|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc UpdateCostumeDetails {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable CostumeDetails
    variable windows

    set l $windows(MainCostumeTab).costumes.data

    if {![string equal $CostumeDetails(audtion) {}]} {
        db eval {
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DeleteCostumeDetails {} {
    ::log::log debug [info level 0]
    variable CostumeDetails

    if {![string equal $CostumeDetails(audtion) {}]} {
        db eval {
            delete from costumeassignments
                where auditionnumber = $CostumeDetails(audtion)
                  and characterid = $CostumeDetails(character)
                  and showid  =  $CostumeDetails(character)
        }
    }
    PopulateCostumes
}







|












273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DeleteCostumeDetails {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable CostumeDetails

    if {![string equal $CostumeDetails(audtion) {}]} {
        db eval {
            delete from costumeassignments
                where auditionnumber = $CostumeDetails(audtion)
                  and characterid = $CostumeDetails(character)
                  and showid  =  $CostumeDetails(character)
        }
    }
    PopulateCostumes
}
Changes to src/Functions/PopulatePerformers.tcl.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulatePerformers {} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows
    variable PerformerColList

    set l $windows(MainPerformerTab).performers.data
    set performer $systemInfo(PerformerSelection)
    set allShows [string equal $systemInfo(ShowSelection) {}]







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulatePerformers {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows
    variable PerformerColList

    set l $windows(MainPerformerTab).performers.data
    set performer $systemInfo(PerformerSelection)
    set allShows [string equal $systemInfo(ShowSelection) {}]
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SortPerformers {OrderBy} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows
    variable PerformerColList

    set w $windows(MainPerformerTab).performers.data
    set selection {}
    set performer $systemInfo(PerformerSelection)







|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SortPerformers {OrderBy} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows
    variable PerformerColList

    set w $windows(MainPerformerTab).performers.data
    set selection {}
    set performer $systemInfo(PerformerSelection)
Changes to src/Functions/PopulateShows.tcl.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateShows {} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    set w $windows(MainShowTab).shows.data
    $w delete [$w children {}]
    db eval {select distinct ShowClass from Show order by ShowClass} dataArr {
        $w insert {} end \







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulateShows {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    set w $windows(MainShowTab).shows.data
    $w delete [$w children {}]
    db eval {select distinct ShowClass from Show order by ShowClass} dataArr {
        $w insert {} end \
Changes to src/Functions/SaveInShowStatus.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveInShowStatus {args} {
    ::log::log debug [info level 0]
    variable PerformerDetails

    if {[info exists PerformerDetails(HysellId)] && [info exists PerformerDetails(ShowID)] &&
        ![string equal $PerformerDetails(HysellId) {}] && ![string equal $PerformerDetails(ShowID) {}]} {
        db eval {
            update Casting
                set InShow = trim($PerformerDetails(InShow))







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SaveInShowStatus {args} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable PerformerDetails

    if {[info exists PerformerDetails(HysellId)] && [info exists PerformerDetails(ShowID)] &&
        ![string equal $PerformerDetails(HysellId) {}] && ![string equal $PerformerDetails(ShowID) {}]} {
        db eval {
            update Casting
                set InShow = trim($PerformerDetails(InShow))
Changes to src/Functions/SelectCurrentView.tcl.
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SelectCurrentView {mode {selectList {}} {idList {}}} {
    ::log::log debug [info level 0]
    variable MassUpdate

    if {!$MassUpdate(Enabled)} {
        return
    }

    lassign [GetCurrentTab] tab w index







|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SelectCurrentView {mode {selectList {}} {idList {}}} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable MassUpdate

    if {!$MassUpdate(Enabled)} {
        return
    }

    lassign [GetCurrentTab] tab w index
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GetCurrentTab {} {
    ::log::log debug [info level 0]
    variable windows

    set n $windows(MainNotebook)
    set current [$n index current]
    set found no
    foreach tab {MainShowTab MainAuditionTab MainPerformerTab} {
        set thisTab [$n index $windows($tab)]







|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GetCurrentTab {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    set n $windows(MainNotebook)
    set current [$n index current]
    set found no
    foreach tab {MainShowTab MainAuditionTab MainPerformerTab} {
        set thisTab [$n index $windows($tab)]
Added src/Functions/ServerFunctions.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : ChangeServerState
#
# Description : Serve up the database.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ChangeServerState {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable serverInfo

    if {$serverInfo(state)} {
        ##
        ## Now active
        ##
        GetMyIp
        set serverInfo(tcpSocket) [socket -server AcceptConnection 8080]
        set group 224.5.1.21
        set port  7771
        set serverInfo(udpSocket)  [udp_open]
        fconfigure $serverInfo(udpSocket) -buffering none -remote [list $group $port]
        BroadCastIp
        ::log::log info "\t Started server on $serverInfo(ipAddr):8080"
    } else {
        ##
        ## Now inactive
        ##
        after cancel $serverInfo(afterId)
        close $serverInfo(tcpSocket)
        close $serverInfo(udpSocket)
        ::log::log info "\t Stopped Server"
    }
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : BroadCastIp
#
# Description : Broadcast the TCP/IP host and port we are listinging on.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BroadCastIp {} {
    variable serverInfo
    variable systemInfo

    set serverInfo(afterId) [after 5000 [list BroadCastIp]]
    puts -nonewline $serverInfo(udpSocket) [list server $systemInfo(ShowSelection) $serverInfo(ipAddr) 8080]
    flush $serverInfo(udpSocket)
    return
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : GetMyIP
#
# Description : Get this processes IP address.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GetMyIp {} {
    variable serverInfo

    if { [ catch {
        set ip 127.0.0.1
        set sid [ socket -async [ info hostname ] 22 ]
        set serverInfo(ipAddr) [ lindex [ fconfigure $sid -sockname ] 0 ]
        ::close $sid
    } err ] } {
        catch { ::close $sid }
        puts stderr "myIP error: '$err' on port 22 (sshd). using 127.0.0.1"
    }
    return
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : AcceptConnection
#
# Description : Accept a TCP/IP connection.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc AcceptConnection {channel clientaddr clientport} {
    variable serverInfo

    if { [ catch {
        fconfigure $channel -translation lf -blocking yes
        set status [gets $channel clientRequest]
        ::log::log info "\t Received: {$clientRequest} with status {$status}"
        if {$status > 0} {
            set cmd [lindex $clientRequest 0]
            ::log::log info "\t\t Command is {$cmd}"
            set now [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
            switch -exact -- $cmd {
                REGISTER {
                    set clientName [lindex $clientRequest 1]
                    set reply [RegisterClient $clientName]
                    ::log::log info "\tReply is {$reply}"
                    puts $channel $reply
                    flush $channel
                }
                UPDATE  {
                    set clientId [lindex $clientRequest 1]
                    set dataLength [lindex $clientRequest 2]
                    set data [read $channel $dataLength]
                    ::log::log info "\t\t Data is {$data}"
                    ProcessUpdate $data
                    db eval {
                        update Clients
                            set UploadedAt = $now
                            where ClientId = $clientId
                    }
                }
                GET     {
                    set clientId [lindex $clientRequest 1]
                    set reply [ProccesGet $clientId]
                    ::log::log info "\tReply is {$reply}"
                    puts -nonewline $channel $reply
                    flush $channel
                    db eval {
                        update Clients
                            set DownloadedAt = $now
                            where ClientId = $clientId
                    }
                }
                default {
                    ##
                    ## Unknown command, so we are just going to ingore it
                    ##
                    ::log::log info "\t\t Unkown command: {$cmd}"
                }
            }
        }
        close $channel
    } err ] } {
        ::log::log info "! Error: $err"
        ::log::log info "! ErrorInfo: $::errorInfo"
        ::log::log info "! ErrorCode: $::errorCode"
        catch {close $channel}
    }
    return
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : RegisterClient
#
# Description : Register a client.
#
# Arguments :
#   clientName  - The name of the client being registered
#
# Returns :
#   The reply to the client that contains the allocated client ID to be used in
#   subsequent calls.
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc RegisterClient {clientName} {
    variable systemInfo
    set result {}

    set isFound [db eval {
        select count(*)
            from Clients
            where ShowId = $systemInfo(ShowSelection)
              and ClientName = $clientName
    }]

    if {$isFound} {
        set clientId [db eval {
            select ClientId
                from Clients
                where ShowId = $systemInfo(ShowSelection)
                  and ClientName = $clientName
        }]
    } else {
        set clientId [db eval {select ifnull(max(ClientId),0) from Clients}]
        incr clientId
        db eval {
            insert into Clients (
                ShowId, ClientId, ClientName, Uploaded
            ) values (
                $systemInfo(ShowSelection), $clientId, $clientName, 'No'
            )
        }
    }
    set result [list CLIENT_ID $clientId]

    return $result
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : ProccesGet
#
# Description : Get the data for a client.
#
# Arguments :
#   clientId    - ID of client to get data for
#
# Returns :
#   The reply to the client that consisting of:
#       DATA <dataLenght>
#       <a dictionary of the data>:
#           ShowInfo:   List of: ShowID, ShowDescription, ShowClass
#           Performers: List of performer records
#           Casting:    List of audition records
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ProccesGet {clientId} {
    variable systemInfo

    set result {}
    set dataDict [dict create]

    ##
    ## Build the data dictionary
    ##
    set showId $systemInfo(ShowSelection)

    ##
    ## First get the system information
    ##
    db eval {
        select ShowID, ShowDescription, ShowClass
            from Show
            where ShowID = $showId
    } dbArr {
        dict set dataDict ShowInfo [list $dbArr(ShowID) $dbArr(ShowDescription) $dbArr(ShowClass)]
    }

    ##
    ## Second get all of the performer data
    ##
    set performerData {}
    set performerCols [list \
        HysellId FirstName LastName BirthDate ParentName ParentLast \
        PhoneNumber MobileNumber EmailAddress ParentName2 ParentLast2 \
        PhoneNumber2 MobileNumber2 EmailAddress2 Address City State \
        ZipCode School DancingSchool Active Report Notes \
    ]
    db eval {
            select  HysellId, FirstName, LastName, BirthDate, ParentName,
                    ParentLast, PhoneNumber, MobileNumber, EmailAddress,
                    ParentName2, ParentLast2, PhoneNumber2, MobileNumber2,
                    EmailAddress2, Address, City, State, ZipCode, School,
                    DancingSchool, Active, Report, Notes
            from Performers
    } dbArr {
        set tmpRecord {}
        foreach col $performerCols {
            lappend tmpRecord $dbArr($col)
        }
        lappend performerData $tmpRecord
    }
    dict set dataDict Performers $performerData

    ##
    ## Lastly get all of the current auditions
    ##
    set castingData {}
    db eval {
        select ShowId, HysellId, auditionnumber
            from Casting
            where ShowId = $showId
    } dbArr {
        lappend castingData [list $dbArr(ShowId) $dbArr(HysellId) $dbArr(auditionnumber)]
    }
    dict set dataDict Casting $castingData

    ##
    ## Build the reply
    ##
    set dataLenght [string length $dataDict]
    append result [format {DATA %d} $dataLenght] "\n" $dataDict

    return $result
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : ProcessUpdate
#
# Description : Handle an update from the client.
#
# Arguments :
#   data        - dictionary of information to update
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ProcessUpdate {dataDict} {
    set result {}

    if {[dict exists $dataDict Performers]} {
        ::log::log info "Processing Performers"
        foreach performerDict [dict get $dataDict Performers] {
            ProcessAddPerformer $performerDict
        }
    }
    if {[dict exists $dataDict Castings]} {
        ::log::log info "Processing Castings"
        foreach auditionRecord [dict get $dataDict Castings] {
            AddAudition {*}$auditionRecord
        }
    }

    return;
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : ProcessAddPerformer
#
# Description : Handle an update from the client.
#
# Arguments :
#   performerRecord - A performer record, including audition number
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ProcessAddPerformer {performerDict} {
    ::log::log info "[info level 0]"
    set result {}

    set HysellId [db eval {select ifnull(max(HysellId),0) from Performers}]
    incr HysellId
    set performerCols {
        FirstName LastName Birthdate ParentName
        ParentLast PhoneNumber MobileNumber EmailAddress
        ParentName2 ParentLast2 PhoneNumber2 MobileNumber2
        EmailAddress2 Address City State ZipCode School
        DancingSchool Active Report Notes AuditionNumber ShowId
    }
    foreach col $performerCols {
        set $col [dict get $performerDict $col]
    }
    db eval {
        insert into Performers (
            HysellId, FirstName, LastName, BirthDate, ParentName,
            ParentLast, PhoneNumber, MobileNumber, EmailAddress,
            ParentName2, ParentLast2, PhoneNumber2, MobileNumber2,
            EmailAddress2, Address, City, State, ZipCode, School,
            DancingSchool, Active, Report, Notes
        ) values (
            $HysellId, $FirstName, $LastName, $Birthdate, $ParentName,
            $ParentLast, $PhoneNumber, $MobileNumber, $EmailAddress,
            $ParentName2, $ParentLast2, $PhoneNumber2, $MobileNumber2,
            $EmailAddress2, $Address, $City, $State, $ZipCode, $School,
            $DancingSchool, $Active, $Report, $Notes
        )
    }
    AddAudition $ShowId $HysellId $AuditionNumber

    return;
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : AddAudition
#
# Description : Handle an update from the client.
#
# Arguments :
#   ShowId          - Show ID
#   HysellId        - Performer ID
#   auditionnumber  - Audition Number
#
# Returns : Nothing
#
# Side-Effects : None.
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc AddAudition {ShowId HysellId auditionnumber} {
    ::log::log info "[info level 0]"
    set result {}

    db eval {
        insert into Casting (
            ShowId, HysellId, auditionnumber
        ) values (
            $ShowId, $HysellId, $auditionnumber
        )
    }
    return;
}
Changes to src/Functions/SetCb.tcl.
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################

proc SetCb {w varName value} {
    ::log::log debug [info level 0]
    upvar #0 $varName controlVar

    if {![string equal $controlVar $value]} {
        $w invoke
    }

    focus -force [tk_focusNext $w]







|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################

proc SetCb {w varName value} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    upvar #0 $varName controlVar

    if {![string equal $controlVar $value]} {
        $w invoke
    }

    focus -force [tk_focusNext $w]
Changes to src/Functions/SetPerformer.tcl.
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SetPerformer {w index} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable SetPerformer
    variable PerformerDetails
    variable PerformerColList
    variable MassUpdate
    variable windows

    if {$SetPerformer || $MassUpdate(Enabled)} {
        return;
    }

    set SetPerformer 1


    if {![string equal $w {}]} {
        set selection [lindex [$w selection] 0]
        set dataList [$w item $selection -values]
        set performer [lindex $dataList $index]

        if {[string equal $performer $systemInfo(PerformerSelection)]} {
            set SetPerformer 0
            return
        } elseif {![string equal $performer {}]} {
            set systemInfo(PerformerSelection)  $performer
        }
    }

    if {![string match *showTab* $w]} {
        SortShowInfo {}
    }
    if {![string match *auditionTab* $w]} {
        SortAuditions {}
    }
    if {![string match *performerTab* $w]} {
        SortPerformers {}
    }
    set nb $windows(MainNotebook)
    if {[string equal [$nb tab [$nb index current] -text] {Performer View}]} {
        set windows(performerDetailedArrayName) PerformerDetails
        set menuWidget $windows(Mainmenu).tools
        $menuWidget entryconfigure {Copy Family Information} -state normal
    } elseif {![info exists windows(CopyFamilyInfo)] || ![winfo viewable $windows(CopyFamilyInfo)]} {
        set windows(performerDetailedArrayName) {}
        set menuWidget $windows(Mainmenu).tools
        $menuWidget entryconfigure {Copy Family Information} -state disabled

    }

    PopulatePerformerDetails PerformerDetails

    after 1 {set SetPerformer 0}

    return;







|













>
|
|
|
|

|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>







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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SetPerformer {w index} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable SetPerformer
    variable PerformerDetails
    variable PerformerColList
    variable MassUpdate
    variable windows

    if {$SetPerformer || $MassUpdate(Enabled)} {
        return;
    }

    set SetPerformer 1

    if {![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        if {![string equal $w {}]} {
            set selection [lindex [$w selection] 0]
            set dataList [$w item $selection -values]
            set performer [lindex $dataList $index]

            if {[string equal $performer $systemInfo(PerformerSelection)]} {
                set SetPerformer 0
                return
            } elseif {![string equal $performer {}]} {
                set systemInfo(PerformerSelection)  $performer
            }
        }

        if {![string match *showTab* $w]} {
            SortShowInfo {}
        }
        if {![string match *auditionTab* $w]} {
            SortAuditions {}
        }
        if {![string match *performerTab* $w]} {
            SortPerformers {}
        }
        set nb $windows(MainNotebook)
        if {[string equal [$nb tab [$nb index current] -text] {Performer View}]} {
            set windows(performerDetailedArrayName) PerformerDetails
            set menuWidget $windows(Mainmenu).tools
            $menuWidget entryconfigure {Copy Family Information} -state normal
        } elseif {![info exists windows(CopyFamilyInfo)] || ![winfo viewable $windows(CopyFamilyInfo)]} {
            set windows(performerDetailedArrayName) {}
            set menuWidget $windows(Mainmenu).tools
            $menuWidget entryconfigure {Copy Family Information} -state disabled
        }
    }

    PopulatePerformerDetails PerformerDetails

    after 1 {set SetPerformer 0}

    return;
134
135
136
137
138
139
140
141
142
143
144
145

146
147
148
149
150
151
152
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulatePerformerDetails {arrayName} {
    ::log::log debug [info level 0]
    variable systemInfo
    upvar #0 $arrayName displayArray
    variable PerformerColList


    set performer $systemInfo(PerformerSelection)
    if {[string equal $performer {}]} {
        foreach item $PerformerColList {
            set displayArray($item) {}
        }
    } else {
        db eval {







|




>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc PopulatePerformerDetails {arrayName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    upvar #0 $arrayName displayArray
    variable PerformerColList

    array unset displayArray
    set performer $systemInfo(PerformerSelection)
    if {[string equal $performer {}]} {
        foreach item $PerformerColList {
            set displayArray($item) {}
        }
    } else {
        db eval {
Changes to src/Functions/SetShow.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SetShow {w} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    set selection [$w selection]
    set systemInfo(ShowSelection) [lindex [$w item $selection -values] 1]

    set d $windows(MainShowTab).details.data







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SetShow {w} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    set selection [$w selection]
    set systemInfo(ShowSelection) [lindex [$w item $selection -values] 1]

    set d $windows(MainShowTab).details.data
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SortShowInfo {OrderBy} {
    ::log::log debug [info level 0]
    variable systemInfo
    variable windows

    set w $windows(MainShowTab).details.data
    set performer $systemInfo(PerformerSelection)

    if {[string equal $OrderBy $systemInfo(ShowInfoSortColumn)]} {







|







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc SortShowInfo {OrderBy} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable systemInfo
    variable windows

    set w $windows(MainShowTab).details.data
    set performer $systemInfo(PerformerSelection)

    if {[string equal $OrderBy $systemInfo(ShowInfoSortColumn)]} {
Changes to src/Functions/TableMaintenace.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc TableMaintenace {tableName} {
    ::log::log debug [info level 0]
    variable windows

    if {![info exists windows(tm,toplevel,$tableName)]} {
        CreateTableMaintenaceGui $tableName
    }

    set w $windows(tm,toplevel,$tableName)







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc TableMaintenace {tableName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    if {![info exists windows(tm,toplevel,$tableName)]} {
        CreateTableMaintenaceGui $tableName
    }

    set w $windows(tm,toplevel,$tableName)
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreateTableMaintenaceGui {tableName} {
    ::log::log debug [info level 0]
    variable windows

    set w .tm_$tableName
    toplevel $w
    wm withdraw $w
    wm transient $w .
    set windows(tm,toplevel,$tableName) $w







|







110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreateTableMaintenaceGui {tableName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    set w .tm_$tableName
    toplevel $w
    wm withdraw $w
    wm transient $w .
    set windows(tm,toplevel,$tableName) $w
Changes to src/Functions/ToggleMassupdateMode.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ToggleMassupdateMode {} {
    ::log::log debug [info level 0]
    variable MassUpdate
    variable windows
    variable systemInfo

    set m $windows(Mainmenu).tools.massupdate
    set MassUpdate(SelectionList) {}
    if {$MassUpdate(Enabled)} {







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ToggleMassupdateMode {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable MassUpdate
    variable windows
    variable systemInfo

    set m $windows(Mainmenu).tools.massupdate
    set MassUpdate(SelectionList) {}
    if {$MassUpdate(Enabled)} {
Changes to src/Guis/AuditionEntryGui.tcl.
54
55
56
57
58
59
60

61



62
63
64
65

66
67
68
69
70
71
72
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CloseAuditionEntryGui {w} {
    variable windows





    wm withdraw $w
    set windows(performerDetailedArrayName) {}
    set menuWidget $windows(Mainmenu).tools
    $menuWidget entryconfigure {Copy Family Information} -state disabled

}


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







>

>
>
>
|
|
|
|
>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CloseAuditionEntryGui {w} {
    variable windows
    variable systemInfo

    if {[string equal $systemInfo(Mode) AuditionEntryOnly]} {
        destroy .
    } else {
        wm withdraw $w
        set windows(performerDetailedArrayName) {}
        set menuWidget $windows(Mainmenu).tools
        $menuWidget entryconfigure {Copy Family Information} -state disabled
    }
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
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
115
116
117
118
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildAuditionEntryGui {} {
    ::log::log debug [info level 0]
    variable windows
    variable AuditionEntryGui


    if {[info exists windows(AuditionEntryGui)] && [winfo exists $windows(AuditionEntryGui)]} {
        ClearGui $windows(AuditionEntryGui)
        wm deiconify $windows(AuditionEntryGui)
        return
    }

    set w [toplevel .auditionEntryGui]
    set windows(AuditionEntryGui) $w
    set windows(AuditionEntryGuiMenu) $w.menuBar
    menu $windows(AuditionEntryGuiMenu)
    $windows(AuditionEntryGui) configure -menu $windows(AuditionEntryGuiMenu)
    wm title $windows(AuditionEntryGui) {Ballet Hysell Audtion Entry Screen}
    wm protocol $windows(AuditionEntryGui) WM_DELETE_WINDOW [list CloseAuditionEntryGui $w]

    wm maxsize $windows(AuditionEntryGui) [winfo screenwidth $windows(Main)] [winfo screenheight $windows(Main)]
    wm transient $w .






    set u [::ttk::frame $w.top]
    grid configure $u -sticky ew

    set col 0
    foreach item {ShowClass ShowID ShowDescription} {
        ::ttk::label $u.lbl_$item -text [::msgcat::mc $item]







|


>














>
|
|
>
>
>
>
>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildAuditionEntryGui {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable AuditionEntryGui
    variable systemInfo

    if {[info exists windows(AuditionEntryGui)] && [winfo exists $windows(AuditionEntryGui)]} {
        ClearGui $windows(AuditionEntryGui)
        wm deiconify $windows(AuditionEntryGui)
        return
    }

    set w [toplevel .auditionEntryGui]
    set windows(AuditionEntryGui) $w
    set windows(AuditionEntryGuiMenu) $w.menuBar
    menu $windows(AuditionEntryGuiMenu)
    $windows(AuditionEntryGui) configure -menu $windows(AuditionEntryGuiMenu)
    wm title $windows(AuditionEntryGui) {Ballet Hysell Audtion Entry Screen}
    wm protocol $windows(AuditionEntryGui) WM_DELETE_WINDOW [list CloseAuditionEntryGui $w]
    parray systemInfo
    if {![string equal $systemInfo(Mode) AuditionEntryOnly]} {
        wm transient $w .
        wm maxsize $windows(AuditionEntryGui) [winfo screenwidth $windows(Main)] [winfo screenheight $windows(Main)]
    } else {
        wm maxsize $windows(AuditionEntryGui) [winfo screenwidth .] [winfo screenheight .]
        BuildAuditionMenu $w.menuBar
    }

    set u [::ttk::frame $w.top]
    grid configure $u -sticky ew

    set col 0
    foreach item {ShowClass ShowID ShowDescription} {
        ::ttk::label $u.lbl_$item -text [::msgcat::mc $item]
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222











































#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc AdjustAuto {varName w {negate 0}} {
    ::log::log debug [info level 0]
    upvar #0 $varName controlVar

    if {[winfo exists $w]} {
        if {[info exists controlVar] && ((!$negate && $controlVar) || ($negate && !$controlVar))} {
            $w configure -state normal
        } else {
            $w configure -state readonly
        }
    }
}


















































|










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc AdjustAuto {varName w {negate 0}} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    upvar #0 $varName controlVar

    if {[winfo exists $w]} {
        if {[info exists controlVar] && ((!$negate && $controlVar) || ($negate && !$controlVar))} {
            $w configure -state normal
        } else {
            $w configure -state readonly
        }
    }
}


###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : BuildAuditionMenu
#
# Description : Add the audition specific menu items for when we are in the
#               audition only mode.
#
# Arguments :
#       menuWidget - menu widget
#
# Returns : Nothing
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildAuditionMenu {menuWidget} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"

    menu $menuWidget.file
    $menuWidget add cascade \
        -label {File} \
        -menu $menuWidget.file
    $menuWidget.file add command \
        -label {Synch} \
        -underline 1 \
        -command SynchronizeWithServer
    $menuWidget.file add separator
    $menuWidget.file add command \
        -label {Exit} \
        -underline 1 \
        -command [list after 1 ExitApplication]
}
Changes to src/Guis/AuditionTab.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildAudtionTab {notebook} {
    ::log::log debug [info level 0]
    variable windows

    set windows(MainAuditionTab) [ttk::frame $notebook.auditionTab]
    set d $windows(MainAuditionTab)

    lappend windows(PerformerViews) $d.data
    ttk::treeview $d.data \







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildAudtionTab {notebook} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    set windows(MainAuditionTab) [ttk::frame $notebook.auditionTab]
    set d $windows(MainAuditionTab)

    lappend windows(PerformerViews) $d.data
    ttk::treeview $d.data \
Added src/Guis/ClientRoutineGuis.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : GetClientName
#
# Description : Get this client's name.
#
# Arguments : none
#
# Returns : Nothing
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc GetClientName {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable GetClientNameGui
    variable systemInfo

    set GetClientNameGui(status) 0

    set w [toplevel .getClientName]
    wm title $w {Ballet Hysell Audtion Entry Client}
    wm protocol $w WM_DELETE_WINDOW [list $w.main.buttons.cancel invoke]
    wm resizable $w yes no

    ::ttk::frame $w.main
    grid configure $w.main -sticky nsew
    grid columnconfigure $w $w.main -weight 1
    grid rowconfigure $w $w.main -weight 1

    ::ttk::frame $w.main.data
    grid configure $w.main.data -sticky ew
    ::ttk::label $w.main.data.label \
        -text {Name:}
    ::ttk::entry $w.main.data.entry \
        -textvariable ::systemInfo(clientName)
    grid configure $w.main.data.label $w.main.data.entry -sticky ew
    grid columnconfigure $w.main.data $w.main.data.entry -weight 1

    ::ttk::frame $w.main.buttons
    grid configure $w.main.buttons -sticky ew
    ::ttk::button $w.main.buttons.cancel \
        -text {Cancel} \
        -command {set ::GetClientNameGui(status) -1}
    ::ttk::button $w.main.buttons.done \
        -text {Ok} \
        -default active \
        -command {set ::GetClientNameGui(status) 1}
    bind $w <Return> [list $w.main.buttons.done invoke]
    bind $w <KP_Enter> [list $w.main.buttons.done invoke]
    grid configure x $w.main.buttons.cancel x $w.main.buttons.done x -sticky ew
    grid columnconfigure $w.main.buttons {1 3 5} -weight 1

    grid columnconfigure $w.main $w.main.data -weight 1

    vwait ::GetClientNameGui(status)
    destroy $w

    if {($GetClientNameGui(status) != 1) || ![string length $systemInfo(clientName)]} {
        after 1 {destroy .}
    }

    return;
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : DisplayConnectionStatus
#
# Description : Display the status of the connection to the server.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc DisplayConnectionStatus {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable DisplayConnectionStatusGui
    variable systemInfo

    set DisplayConnectionStatusGui(status) 0

    set w [toplevel .displayConnectionStatusGui]
    set windows(DisplayConnectionStatus) $w
    wm title $w {Server Connection Status}
    wm attributes $w -topmost yes
    wm protocol $w WM_DELETE_WINDOW {after 1 {destroy .}}
    wm resizable $w yes no

    ::ttk::frame $w.main
    grid configure $w.main -sticky nsew
    grid columnconfigure $w $w.main -weight 1
    grid rowconfigure $w $w.main -weight 1

    ::ttk::frame $w.main.data
    grid configure $w.main.data -sticky ew
    ::ttk::label $w.main.data.label \
        -textvariable ::DisplayConnectionStatusGui(statusMessage) \
        -width 80
    grid configure $w.main.data.label -sticky ew
    grid columnconfigure $w.main.data $w.main.data.label -weight 1

    grid columnconfigure $w.main $w.main.data -weight 1

    return;
}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : UndisplayConnectionStatus
#
# Description : Display the status of the connection to the server.
#
# Arguments : None
#
# Returns : Nothing
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc UndisplayConnectionStatus {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    set w $windows(DisplayConnectionStatus)
    destroy $w

    return;
}
Changes to src/Guis/CopyFamilyInfoGui.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildCopyFamilyInfo {} {

    ::log::log debug [info level 0]
    variable windows
    variable CopyFamilyInfo

    if {[info exists windows(CopyFamilyInfoGui)] && [winfo exists $windows(CopyFamilyInfoGui)]} {
        ClearGui $windows(CopyFamilyInfoGui)
        wm deiconify $windows(CopyFamilyInfoGui)
        return







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildCopyFamilyInfo {} {

    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CopyFamilyInfo

    if {[info exists windows(CopyFamilyInfoGui)] && [winfo exists $windows(CopyFamilyInfoGui)]} {
        ClearGui $windows(CopyFamilyInfoGui)
        wm deiconify $windows(CopyFamilyInfoGui)
        return
Changes to src/Guis/CostumeEntryGui.tcl.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildCostumeEntryGui {} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeEntryGui

    if {[info exists windows(CostumeEntryGui)] && [winfo exists $windows(CostumeEntryGui)]} {
        wm deiconify $windows(CostumeEntryGui)
        return
    }







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildCostumeEntryGui {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeEntryGui

    if {[info exists windows(CostumeEntryGui)] && [winfo exists $windows(CostumeEntryGui)]} {
        wm deiconify $windows(CostumeEntryGui)
        return
    }
Changes to src/Guis/CostumeTab.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildCostumeTab {notebook} {
    ::log::log debug [info level 0]
    variable windows
    variable CostumeColList

    set windows(MainCostumeTab) [ttk::panedwindow $notebook.costumeTab -orient vertical]
    set w $windows(MainCostumeTab)

    ##







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildCostumeTab {notebook} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable CostumeColList

    set windows(MainCostumeTab) [ttk::panedwindow $notebook.costumeTab -orient vertical]
    set w $windows(MainCostumeTab)

    ##
Changes to src/Guis/CreatePerformerDetailGui.tcl.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreatePerformerDetailGui {w arrayName} {
    ::log::log debug [info level 0]
    variable PerformerColList

    foreach col $PerformerColList {
        if {$col in {HysellId Active Report}} {
            continue
        }
        ::ttk::label $w.lbl_$col -text [::msgcat::mc $col]







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc CreatePerformerDetailGui {w arrayName} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable PerformerColList

    foreach col $PerformerColList {
        if {$col in {HysellId Active Report}} {
            continue
        }
        ::ttk::label $w.lbl_$col -text [::msgcat::mc $col]
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ValidateDate {arrayName new} {
    ::log::log debug [info level 0]
    upvar #0 $arrayName dataArr
    if {[string equal $new {}]} {
        set status true
    } elseif {[catch {clock scan $new} ts]} {
        bell
        if {![info exists dataArr(HysellId)] || [string equal $dataArr(HysellId) {}]} {
            set dataArr(BirthDate) {}







|







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ValidateDate {arrayName new} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    upvar #0 $arrayName dataArr
    if {[string equal $new {}]} {
        set status true
    } elseif {[catch {clock scan $new} ts]} {
        bell
        if {![info exists dataArr(HysellId)] || [string equal $dataArr(HysellId) {}]} {
            set dataArr(BirthDate) {}
217
218
219
220
221
222
223
224
225
226
227
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc InvalidDate {w} {
    ::log::log debug [info level 0]
    after 1 [list focus -force $w]
    $w selection range 0 end
}







|



217
218
219
220
221
222
223
224
225
226
227
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc InvalidDate {w} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    after 1 [list focus -force $w]
    $w selection range 0 end
}
Changes to src/Guis/MainWindow.tcl.
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
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name :
#
# Description : Get the type cross reference information for a service.
#
# Arguments :
#       mode            - Client|Server
#
# Returns : Nothing
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildMainWindow {} {
    ::log::log debug [info level 0]
    variable windows

    set windows(Main) .
    set windows(MainNotebook) .nb
    set windows(Mainmenu) .menuBar

    ##







|
<













|







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
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name :
#
# Description : Get the type cross reference information for a service.
#
# Arguments : None

#
# Returns : Nothing
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildMainWindow {} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    set windows(Main) .
    set windows(MainNotebook) .nb
    set windows(Mainmenu) .menuBar

    ##
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166







167
168
169
170
171
172
173
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildMainMenu {top menuWidget} {
    ::log::log debug [info level 0]
    variable windows

    ##
    ## Add in File menu
    ##
    $menuWidget add cascade \
        -label {File} \
        -underline 0 \
        -menu $menuWidget.file
    menu $menuWidget.file
    $menuWidget.file add cascade \
        -label {Reports} \
        -underline 0 \
        -menu $menuWidget.file.report
    menu $menuWidget.file.report -postcommand [list BuildReportMenu $menuWidget.file.report]







    $menuWidget.file add separator
    $menuWidget.file add command \
        -label {Exit} \
        -underline 1 \
        -command [list after 1 ExitApplication]

    ##







|















>
>
>
>
>
>
>







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildMainMenu {top menuWidget} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    ##
    ## Add in File menu
    ##
    $menuWidget add cascade \
        -label {File} \
        -underline 0 \
        -menu $menuWidget.file
    menu $menuWidget.file
    $menuWidget.file add cascade \
        -label {Reports} \
        -underline 0 \
        -menu $menuWidget.file.report
    menu $menuWidget.file.report -postcommand [list BuildReportMenu $menuWidget.file.report]
    $menuWidget.file add checkbutton \
        -label {Serve DB} \
        -underline 1 \
        -command {ChangeServerState} \
        -onvalue yes \
        -offvalue no \
        -variable ::serverInfo(state)
    $menuWidget.file add separator
    $menuWidget.file add command \
        -label {Exit} \
        -underline 1 \
        -command [list after 1 ExitApplication]

    ##
Changes to src/Guis/PerformerTab.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildPerformerTab {notebook} {
    ::log::log debug [info level 0]
    variable windows
    variable PerformerDetails
    variable PerformerColList

    set windows(MainPerformerTab) [ttk::panedwindow $notebook.performerTab -orient vertical]
    set w $windows(MainPerformerTab)








|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildPerformerTab {notebook} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows
    variable PerformerDetails
    variable PerformerColList

    set windows(MainPerformerTab) [ttk::panedwindow $notebook.performerTab -orient vertical]
    set w $windows(MainPerformerTab)

Added src/Guis/ServerFunctionGuis.tcl.
Changes to src/Guis/ShowTab.tcl.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildShowTab {notebook} {
    ::log::log debug [info level 0]
    variable windows

    set windows(MainShowTab) [ttk::panedwindow $notebook.showTab -orient vertical]
    set w $windows(MainShowTab)

    ##
    ## Create the show selector







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc BuildShowTab {notebook} {
    ::log::log debug "[string repeat { } [info level]][info level 0]"
    variable windows

    set windows(MainShowTab) [ttk::panedwindow $notebook.showTab -orient vertical]
    set w $windows(MainShowTab)

    ##
    ## Create the show selector
Changes to src/Guis/TkError.tcl.
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
        puts stderr $msg
        puts stderr {}
        puts stderr {}
    }
    catch {
        tk_messageBox \
            -default ok \
            -detail $msg
            -icon error \
            -message {Unexpected application error encountered.} \
            -parent . \
            -title {Applicaiton Error}
            -type ok
    }








|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
        puts stderr $msg
        puts stderr {}
        puts stderr {}
    }
    catch {
        tk_messageBox \
            -default ok \
            -detail $msg \
            -icon error \
            -message {Unexpected application error encountered.} \
            -parent . \
            -title {Applicaiton Error}
            -type ok
    }

Changes to src/Main.tcl.
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
91
92
93
94
95
96
97
package require tdbc 1.0
package require tdbc::sqlite3
package require msgcat
package require csv
package require log
package require struct
package require struct::set


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 SetPerformer 0
set SetPerformerFirstTime 1

array set AuditionEntryGui {
    EnterAuditionNumber Y
    ExistingDancer Y
    InShow N
}




##
## Load the message catalogs
##
foreach dir [list $baseDir ~/ [pwd]] {
    set msgDir [file join $dir msgcat]
    if {[file exists $msgDir]} {
        ::msgcat::mcload $msgDir
    }
}

##
## Source in all the function files
##
foreach file [glob [file join $baseDir Functions *.tcl]] {
    source $file
}

##
## Source in all the Gui files
##
foreach file [glob [file join $baseDir Guis *.tcl]] {
    source $file
}

##
## Source in all the core upgrade files
##
foreach file [glob [file join $baseDir Upgrades *.tcl]] {
    source $file
}

##
## Add default bindings
##
bind TEntry <Command-a> { %W selection range 0 end; %W icursor end }







>

















>
>
>













|






|






|







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
91
92
93
94
95
96
97
98
99
100
101
package require tdbc 1.0
package require tdbc::sqlite3
package require msgcat
package require csv
package require log
package require struct
package require struct::set
package require udp

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 SetPerformer 0
set SetPerformerFirstTime 1

array set AuditionEntryGui {
    EnterAuditionNumber Y
    ExistingDancer Y
    InShow N
}

set systemInfo(iniFile) .HysellDbInfo
set serverInfo(state) no

##
## Load the message catalogs
##
foreach dir [list $baseDir ~/ [pwd]] {
    set msgDir [file join $dir msgcat]
    if {[file exists $msgDir]} {
        ::msgcat::mcload $msgDir
    }
}

##
## Source in all the function files
##
foreach file [glob -- [file join $baseDir Functions *.tcl]] {
    source $file
}

##
## Source in all the Gui files
##
foreach file [glob -- [file join $baseDir Guis *.tcl]] {
    source $file
}

##
## Source in all the core upgrade files
##
foreach file [glob -- [file join $baseDir Upgrades *.tcl]] {
    source $file
}

##
## Add default bindings
##
bind TEntry <Command-a> { %W selection range 0 end; %W icursor end }
114
115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140


		*indicator -
		*disclosure { Toggle $w $item }
	    }
	}
        cell {
            ttk::treeview::Select $w $x $y toggle
        }

    }
}

BuildMainWindow

SetDefaultContext

#after 1 [list trace add variable systemInfo(ShowSelection) write PopulateAuditions]

InitializeSystem
db function isAdult isAdult

ApplyUpgrades

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

PopulatePerformerDetails PerformerDetails

SaveSystemInfo









>




















>
>
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
		*indicator -
		*disclosure { Toggle $w $item }
	    }
	}
        cell {
            ttk::treeview::Select $w $x $y toggle
        }
        default {}
    }
}

BuildMainWindow

SetDefaultContext

#after 1 [list trace add variable systemInfo(ShowSelection) write PopulateAuditions]

InitializeSystem
db function isAdult isAdult

ApplyUpgrades

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

PopulatePerformerDetails PerformerDetails

SaveSystemInfo

::log::lvSuppress info 0
Added src/PreAuditionMain.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
91
92
93
94
95
###############################################################################
##                                                                           ##
##  Copyright (c) 2012 Gerald W. Lester                                      ##
##  All rights reserved.                                                     ##
##                                                                           ##
##  Redistribution and use in source and binary forms, with or without       ##
##  modification, are permitted provided that the following conditions       ##
##  are met:                                                                 ##
##                                                                           ##
##    * Redistributions of source code must retain the above copyright       ##
##      notice, this list of conditions and the following disclaimer.        ##
##    * Redistributions in binary form must reproduce the above              ##
##      copyright notice, this list of conditions and the following          ##
##      disclaimer in the documentation and/or other materials provided      ##
##      with the distribution.                                               ##
##    * Neither the name of the Visiprise Software, Inc nor the names        ##
##      of its contributors may be used to endorse or promote products       ##
##      derived from this software without specific prior written            ##
##      permission.                                                          ##
##                                                                           ##
##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      ##
##  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        ##
##  LIMITED  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS       ##
##  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE           ##
##  COPYRIGHT OWNER OR  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,     ##
##  INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,    ##
##  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;        ##
##  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER         ##
##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################

package require Tcl 8.6
package require Tk 8.6
package require sqlite3
package require tdbc 1.0
package require tdbc::sqlite3
package require msgcat
package require log
package require struct
package require struct::set
package require udp

#::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 SetPerformer 0
set SetPerformerFirstTime 1

array set AuditionEntryGui {
    EnterAuditionNumber Y
    ExistingDancer Y
    InShow N
}

set systemInfo(DatabaseFile) ~/Audition.db
set systemInfo(iniFile) Audition.ini
set systemInfo(Mode) AuditionEntryOnly

##
## Add default bindings
##
bind TEntry <Command-a> { %W selection range 0 end; %W icursor end }
bind Entry <Command-a> { %W selection range 0 end; %W icursor end }

##
## Replace standard Treeview behavior of unmodified button 1
##
bind Treeview <Command-Button-1> [bind Treeview <Control-Button-1>]
proc ttk::treeview::Press {w x y} {
    focus $w
    switch -- [$w identify region $x $y] {
	nothing { }
	heading { heading.press $w $x $y }
	separator { resize.press $w $x $y }
	tree {
	    set item [$w identify item $x $y]
	    SelectOp $w $item choose
	    switch -glob -- [$w identify element $x $y] {
		*indicator -
		*disclosure { Toggle $w $item }
	    }
	}
        cell {
            ttk::treeview::Select $w $x $y toggle
        }
    }
}
Changes to src/Upgrades/CurrentVersion.tcl.
38
39
40
41
42
43
44
45
46
47
48
##
## This is used to deal with database and initalization file upgrades.
##
## NOTE -- in a release all of the version numbers may or may not change,
#          only the Code version number has to change with every release.
##
array set CurrentVersion {
    InitFile    0.5.0
    Database    0.5.0
    Code        0.5.0
}







|
|
|

38
39
40
41
42
43
44
45
46
47
48
##
## This is used to deal with database and initalization file upgrades.
##
## NOTE -- in a release all of the version numbers may or may not change,
#          only the Code version number has to change with every release.
##
array set CurrentVersion {
    InitFile    0.6.0
    Database    0.6.0
    Code        0.6.0
}
Added src/Upgrades/Database/From_0.5.0_To_0.6.0.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
###############################################################################
##                                                                           ##
##  Copyright (c) 2012 Gerald W. Lester                                      ##
##  All rights reserved.                                                     ##
##                                                                           ##
##  Redistribution and use in source and binary forms, with or without       ##
##  modification, are permitted provided that the following conditions       ##
##  are met:                                                                 ##
##                                                                           ##
##    * Redistributions of source code must retain the above copyright       ##
##      notice, this list of conditions and the following disclaimer.        ##
##    * Redistributions in binary form must reproduce the above              ##
##      copyright notice, this list of conditions and the following          ##
##      disclaimer in the documentation and/or other materials provided      ##
##      with the distribution.                                               ##
##    * Neither the name of the Visiprise Software, Inc nor the names        ##
##      of its contributors may be used to endorse or promote products       ##
##      derived from this software without specific prior written            ##
##      permission.                                                          ##
##                                                                           ##
##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      ##
##  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        ##
##  LIMITED  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS       ##
##  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE           ##
##  COPYRIGHT OWNER OR  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,     ##
##  INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,    ##
##  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;        ##
##  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER         ##
##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################

set ::ApplyUpgrades::UpgradeScripts(Database,0.5.0) ::ApplyUpgrades::Database::From_0.5.0_To_0.6.0

namespace eval  ::ApplyUpgrades::Database:: {}

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : ::ApplyUpgrades::Database::From_0.5.0_To_0.6.0
#
# Description : Upgrade the database from 0.5.0 to 0.6.0. This entails the following:
#                   Creating the Clients and ClientHysellMap table.
#
# Arguments : None
#
# Returns : Upgraded version number
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ::ApplyUpgrades::Database::From_0.5.0_To_0.6.0 {} {
    ##
    ## Define the new Clients Table
    ##
    db eval {
        create table Clients (
            ShowId          Text,
            ClientId        Text,
            ClientName      Text,
            Uploaded        Boolean,
            DownloadedAt    Date,
            UploadedAt      Date
        )
    }

    ##
    ## Define the new ClientHysellMap Table
    ##
    db eval {
        create table ClientHysellMap (
            ClientId        Text,
            LocalHID        Integer,
            HyselID         Integer
        )
    }

    return {0.6.0}
}
Added src/Upgrades/InitFile/From_0.5.0_To_0.6.0.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
###############################################################################
##                                                                           ##
##  Copyright (c) 2012 Gerald W. Lester                                      ##
##  All rights reserved.                                                     ##
##                                                                           ##
##  Redistribution and use in source and binary forms, with or without       ##
##  modification, are permitted provided that the following conditions       ##
##  are met:                                                                 ##
##                                                                           ##
##    * Redistributions of source code must retain the above copyright       ##
##      notice, this list of conditions and the following disclaimer.        ##
##    * Redistributions in binary form must reproduce the above              ##
##      copyright notice, this list of conditions and the following          ##
##      disclaimer in the documentation and/or other materials provided      ##
##      with the distribution.                                               ##
##    * Neither the name of the Visiprise Software, Inc nor the names        ##
##      of its contributors may be used to endorse or promote products       ##
##      derived from this software without specific prior written            ##
##      permission.                                                          ##
##                                                                           ##
##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      ##
##  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        ##
##  LIMITED  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS       ##
##  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE           ##
##  COPYRIGHT OWNER OR  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,     ##
##  INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,    ##
##  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;        ##
##  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER         ##
##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################

set ::ApplyUpgrades::UpgradeScripts(InitFile,0.5.0) ::ApplyUpgrades::InitFile::From_0.5.0_To_0.6.0

###########################################################################
#
# Procedure Header - as this procedure is modified, please be sure
#                           that you update this header block. Thanks.
#
# Procedure Name : InitFile::From_0.5.0_To_0.6.0
#
# Description : Add additional entry to the initialization file for version number.
#
# Arguments : None.
#
# Returns : Upgraded version number
#
# Side-Effects : None
#
# Exception Conditions : None
#
# Pre-requisite Conditions : None
#
# Original Author : Gerald W. Lester
#
###########################################################################
proc ::ApplyUpgrades::InitFile::From_0.5.0_To_0.6.0 {} {
    global systemInfo

    set systemInfo(InitFile) {0.6.0}
    set systemInfo(Mode) {Standalone}
    set systemInfo(ClientId) {}

    return {0.6.0}
}