Check-in [130b6a118d]

Not logged in
Tcl 2015 Conference, Manassas/VA, US, Oct 19-23
Send your abstracts to tclconference@googlegroups.com by Aug 24.

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

Overview
Comment:Extended conference/proceedings with global links to show (ex: lulu, pic galleries, etc). Basic commands: add, list, website integration.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | active-on-core
Files: files | file ages | folders
SHA3-256:130b6a118dffd5c627677f9e4328791e9d36a5b1d5b7b9d8ae8ab381eae8fe4a
User & Date: aku 2017-10-24 20:07:23
Context
2017-10-25
04:22
Fix description errors for series rename/redirect. Added command to show submission attachments in one table (like the material table in the website). check-in: 6b060df161 user: aku tags: active-on-core
2017-10-24
20:07
Extended conference/proceedings with global links to show (ex: lulu, pic galleries, etc). Basic commands: add, list, website integration. check-in: 130b6a118d user: aku tags: active-on-core
2017-10-11
19:09
Extended contact management with 3 commands to manage links better: Rename, Title, List. check-in: c05ea3a66e user: aku tags: active-on-core
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/cm.tcl.

912
913
914
915
916
917
918




















919
920
921
922
923
924
925
	    input template {
		Name of the template holding mail subject and body.
	    } { optional ; 
		generate [cm::call template find mail-sponsors]
		validate [cm::vt template] }
	    # TODO: Allow for external file and/or stdin as mail input.
	} [cm::call conference cmd_sponsor_ping]





















	# - -- --- ----  -------- ------------- ----------------------

	private add-staff {
	    section {Conference Management}
	    description { Add one or more staff }
	    input role {







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







912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
	    input template {
		Name of the template holding mail subject and body.
	    } { optional ; 
		generate [cm::call template find mail-sponsors]
		validate [cm::vt template] }
	    # TODO: Allow for external file and/or stdin as mail input.
	} [cm::call conference cmd_sponsor_ping]

	# - -- --- ----  -------- ------------- ----------------------

	private attach {
	    section {Conference Management}
	    description { Add a link for the proceedings }
	    input link {
		URI of the link
	    } {
		validate str
	    }
	    input title {
		Label to use for the link, defaults to the link itself.
	    } { optional }
	} [cm::call conference cmd_link_add]

	private links {
	    section {Conference Management}
	    description { Show the attached links }
	} [cm::call conference cmd_link_show]

	# - -- --- ----  -------- ------------- ----------------------

	private add-staff {
	    section {Conference Management}
	    description { Add one or more staff }
	    input role {

Changes to lib/conference.tcl.

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
...
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
....
2432
2433
2434
2435
2436
2437
2438

















































2439
2440
2441
2442
2443
2444
2445
....
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
....
4152
4153
4154
4155
4156
4157
4158

















4159
4160
4161
4162
4163
4164
4165
....
4561
4562
4563
4564
4565
4566
4567

4568
4569
4570
4571
4572
4573
4574
....
4615
4616
4617
4618
4619
4620
4621
4622
4623






4624

4625
4626
4627
4628
4629
4630
4631
....
7030
7031
7032
7033
7034
7035
7036




















7037
7038
7039
7040
7041
7042
7043
....
7285
7286
7287
7288
7289
7290
7291



















7292
7293
7294
7295
7296
7297
7298
	select-sponsor select-staff-role known-staff-role select-staff known-staff \
	known-rstatus known-pvisible get-role select-timeline get-timeline select-submission get-submission \
	get-submission-handle known-submissions-vt known-timeline-validation \
	get-talk-type get-talk-state known-talk-type known-talk-stati known-speaker \
	known-attachment get-attachment known-submitter its-hotel \
	known-talks-vt \
	\
	test-timeline-known
    namespace ensemble create

    namespace import ::cmdr::ask
    namespace import ::cmdr::color
    namespace import ::cmdr::validate::date
    namespace import ::cmdr::validate::weekday
    namespace import ::cmdr::validate::time::minute
................................................................................
	$t add @Hotel           $xhotel
	$t add @Facility        $xfacility
	$t add {} {}
	$t add Minutes/Talk     $xtalklen
	$t add Talks/Session    $xsesslen

	if {$xpschedule eq {}} {
	    $t add Schedule "[color bad {Undefined}]\n(=> conference schedule)"
	} else {
	    $t add Schedule [pschedule piece $xpschedule dname]
	}

	$t add {} {}

	# - -- --- ----  -------- ------------- rate info
	if {![db do exists {
	    SELECT *
	    FROM   rate
	    WHERE  conference = :id
	    AND    location   = :xhotelid
	}]} {
	    $t add [color bad Rate]  "[color bad Undefined]\n(=> conference rate)"
	} else {
	    $t add [color note Rate] "[color note ok]\n(=> conference rates)"
	}

	# - -- --- ----  -------- ------------- timeline
	set tcount [db do eval {
	    SELECT count (id)
	    FROM   timeline
	    WHERE  con = :id
	}]
	if {!$tcount} {
	    set tcount Undefined
	    set color  bad
	    set suffix "\n(=> conference timeline-init)"
	} else {
	    set color  note
	    set suffix "\n(=> conference timeline)"
	}
	$t add [color $color Timeline] [color $color $tcount]$suffix

	# - -- --- ----  -------- ------------- sponsors
	# And the sponsors, if any.
	set scount [db do eval {
	    SELECT count (id)
	    FROM   sponsors
	    WHERE  conference = :id
	}]
	if {!$scount} {
	    set scount None
	    set color  bad
	    set suffix "\n(=> conference add-sponsor)"
	} else {
	    set color  note
	    set suffix "\n(=> conference sponsors)"
	}
	$t add [color $color Sponsors] [color $color $scount]$suffix

	# - -- --- ----  -------- ------------- staff
	set scount [db do eval {
	    SELECT count (id)
	    FROM   conference_staff
	    WHERE  conference = :id
	}]
	if {!$scount} {
	    set scount None
	    set color  bad
	    set suffix "\n(=> conference add-staff)"
	} else {
	    set color  note
	    set suffix "\n(=> conference staff)"
	}
	$t add [color $color Staff] [color $color $scount]$suffix

	# - -- --- ----  -------- ------------- tutorial summary
	set tcount [db do eval {
	    SELECT count (id)
	    FROM   tutorial_schedule
	    WHERE  conference = :id
	}]
	if {!$tcount} {
	    set tcount None
	    set color  bad
	    set suffix "\n(=> conference add-tutorial)"
	} else {
	    set color  note
	    set suffix "\n(=> conference tutorials)"
	}
	$t add [color $color Tutorials] [color $color $tcount]$suffix

	# - -- --- ----  -------- ------------- submission summary
	set scount [db do eval {
	    SELECT count (id)
	    FROM   submission
	    WHERE  conference = :id
	}]
	if {!$scount} {
	    set scount None
	    set color  bad
	    set suffix "\n(=> submit)"
	} else {
	    set color  note
	    set suffix "\n(=> submissions)"
	}
	$t add [color $color Submissions] [color $color $scount]$suffix

	# - -- --- ----  -------- ------------- talk summary /TODO














    }] show

    return
}

proc ::cm::conference::cmd_series {config} {
    debug.cm/conference {}
    Setup
    db show-location
................................................................................
	puts [color good OK]
    }
    return
}

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


















































proc ::cm::conference::cmd_rate_show {config} {
    debug.cm/conference {}
    Setup
    db show-location

    set conference [current]
    set details [details $conference]
................................................................................
    } else {
	make_page  Speakers  bios  make_speakers_none
    }

    if {$pvisible eq "visible"} {
	lappend navbar {*}[make_page Proceedings  proceedings make_proceedings $conference]
    } else {
	lappend navbar {*}[make_page Proceedings  proceedings make_proceedings_none]
    }

    #lappend navbar {*}[make_page Contact           contact     make_contact]
    make_page                    Disclaimer        disclaimer  make_disclaimer
    make_page   {Registration Confirmation}        confirm     make_confirm

    make_internal_page Administrivia __dwarf make_admin $conference
................................................................................
	AND   TR.talk      = T.id
	AND   TR.contact   = C.id
	AND   T.type       = TT.id
	AND   TT.text     != 'keynote'
	ORDER BY dname
    }]
}


















proc ::cm::conference::talk-speakers {talk} {
    debug.cm/conference {}
    return [db do eval {
	SELECT DISTINCT dname, tag
	FROM   contact
	WHERE  id IN (SELECT contact
................................................................................

proc ::cm::conference::make_proceedings {conference} {
    debug.cm/conference {}
    upvar 1 dstdir dstdir

    set text [template use www-proceedings]
    append text \n


    set first 1
    set n 1
    db do eval {
	SELECT S.id         AS id,
	       S.title      AS title
	FROM   submission S
................................................................................
	append text |$title|$speakers|$attachments|\n
    }

    append text \n
    return $text
}

proc ::cm::conference::make_proceedings_none {} {
    debug.cm/conference {}






    return [template use www-proceedings.none]

}

proc ::cm::conference::make_admin {conference} {
    debug.cm/conference {}
    upvar 1 dstdir dstdir

    set issues [issues [details $conference]]
................................................................................
    } else {
	db do eval {
	    INSERT OR IGNORE INTO talk_state VALUES (1,'pending');
	    INSERT OR IGNORE INTO talk_state VALUES (2,'received');
	}
    }





















    # Shortcircuit further calls
    proc ::cm::conference::Setup {args} {}
    return
}


proc ::cm::conference::Dump {} {
................................................................................
		    < [cm dump write attachment$aid $value \
			   -encoding binary \
			   -translation binary]
	    }
	    
	    cm dump step
	}




















	# booked
	set first 1
	db do eval {
	    SELECT C.dname  AS contact
	    ,      L.name   AS name
	    ,      Y.name   AS city







|







 







|













|

|











|


|













|


|












|


|












|


|












|


|



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

>







 







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







 







|







 







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







 







>







 







|

>
>
>
>
>
>
|
>







 







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







 







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







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
...
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
....
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
....
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
....
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
....
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
....
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
....
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
....
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
	select-sponsor select-staff-role known-staff-role select-staff known-staff \
	known-rstatus known-pvisible get-role select-timeline get-timeline select-submission get-submission \
	get-submission-handle known-submissions-vt known-timeline-validation \
	get-talk-type get-talk-state known-talk-type known-talk-stati known-speaker \
	known-attachment get-attachment known-submitter its-hotel \
	known-talks-vt \
	\
	test-timeline-known cmd_link_add cmd_link_drop cmd_link_show
    namespace ensemble create

    namespace import ::cmdr::ask
    namespace import ::cmdr::color
    namespace import ::cmdr::validate::date
    namespace import ::cmdr::validate::weekday
    namespace import ::cmdr::validate::time::minute
................................................................................
	$t add @Hotel           $xhotel
	$t add @Facility        $xfacility
	$t add {} {}
	$t add Minutes/Talk     $xtalklen
	$t add Talks/Session    $xsesslen

	if {$xpschedule eq {}} {
	    $t add Schedule "[color bad {Undefined}] (=> conference schedule)"
	} else {
	    $t add Schedule [pschedule piece $xpschedule dname]
	}

	$t add {} {}

	# - -- --- ----  -------- ------------- rate info
	if {![db do exists {
	    SELECT *
	    FROM   rate
	    WHERE  conference = :id
	    AND    location   = :xhotelid
	}]} {
	    $t add [color bad Rate]  "[color bad Undefined] (=> conference rate)"
	} else {
	    $t add [color note Rate] "[color note ok] (=> conference rates)"
	}

	# - -- --- ----  -------- ------------- timeline
	set tcount [db do eval {
	    SELECT count (id)
	    FROM   timeline
	    WHERE  con = :id
	}]
	if {!$tcount} {
	    set tcount Undefined
	    set color  bad
	    set suffix " (=> conference timeline-init)"
	} else {
	    set color  note
	    set suffix " (=> conference timeline)"
	}
	$t add [color $color Timeline] [color $color $tcount]$suffix

	# - -- --- ----  -------- ------------- sponsors
	# And the sponsors, if any.
	set scount [db do eval {
	    SELECT count (id)
	    FROM   sponsors
	    WHERE  conference = :id
	}]
	if {!$scount} {
	    set scount None
	    set color  bad
	    set suffix " (=> conference add-sponsor)"
	} else {
	    set color  note
	    set suffix " (=> conference sponsors)"
	}
	$t add [color $color Sponsors] [color $color $scount]$suffix

	# - -- --- ----  -------- ------------- staff
	set scount [db do eval {
	    SELECT count (id)
	    FROM   conference_staff
	    WHERE  conference = :id
	}]
	if {!$scount} {
	    set scount None
	    set color  bad
	    set suffix " (=> conference add-staff)"
	} else {
	    set color  note
	    set suffix " (=> conference staff)"
	}
	$t add [color $color Staff] [color $color $scount]$suffix

	# - -- --- ----  -------- ------------- tutorial summary
	set tcount [db do eval {
	    SELECT count (id)
	    FROM   tutorial_schedule
	    WHERE  conference = :id
	}]
	if {!$tcount} {
	    set tcount None
	    set color  bad
	    set suffix " (=> conference add-tutorial)"
	} else {
	    set color  note
	    set suffix " (=> conference tutorials)"
	}
	$t add [color $color Tutorials] [color $color $tcount]$suffix

	# - -- --- ----  -------- ------------- submission summary
	set scount [db do eval {
	    SELECT count (id)
	    FROM   submission
	    WHERE  conference = :id
	}]
	if {!$scount} {
	    set scount None
	    set color  bad
	    set suffix " (=> submit)"
	} else {
	    set color  note
	    set suffix " (=> submissions)"
	}
	$t add [color $color Submissions] [color $color $scount]$suffix

    	# - -- --- ----  -------- ------------- link summary (global "attachments")
	set lcount [db do eval {
	    SELECT count (id)
	    FROM   clink
	    WHERE  conference = :id
	}]
	if {!$lcount} {
	    set lcount None
	    set color  bad
	    set suffix " (=> conference attach)"
	} else {
	    set color  note
	    set suffix " (=> conference links)"
	}
	$t add [color $color Links] [color $color $lcount]$suffix
    }] show
    # - -- --- ----  -------- ------------- talk summary /TODO
    return
}

proc ::cm::conference::cmd_series {config} {
    debug.cm/conference {}
    Setup
    db show-location
................................................................................
	puts [color good OK]
    }
    return
}

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

proc ::cm::conference::cmd_link_show {config} {
    debug.cm/conference {}
    Setup
    db show-location

    set conference [current]

    puts "Links attached to \"[color name [get $conference]]\":"
    [table t {Title Link} {
	db do eval {
	    SELECT C.title AS title
	    ,      C.link AS link
	    FROM   clink C
	    WHERE  C.conference = :conference
	    ORDER BY title, link
	} {
	    $t add $title $link
	}
    }] show
    return
}

proc ::cm::conference::cmd_link_add {config} {
    debug.cm/conference {}
    Setup
    db show-location

    set link  [$config @link]
    set title [$config @title]
    set id    [current]

    if {$title eq {}} { set title $link }
    
    puts -nonewline "Add link \"[color name $link]\" to \"[color name [get $id]]\" ... "
    flush stdout

    db do transaction {
	db do eval {
	    INSERT INTO clink
	    VALUES (NULL, :id, :link, :title)
	}
    }

    puts [color good OK]
    return
}

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

proc ::cm::conference::cmd_rate_show {config} {
    debug.cm/conference {}
    Setup
    db show-location

    set conference [current]
    set details [details $conference]
................................................................................
    } else {
	make_page  Speakers  bios  make_speakers_none
    }

    if {$pvisible eq "visible"} {
	lappend navbar {*}[make_page Proceedings  proceedings make_proceedings $conference]
    } else {
	lappend navbar {*}[make_page Proceedings  proceedings make_proceedings_none $conference]
    }

    #lappend navbar {*}[make_page Contact           contact     make_contact]
    make_page                    Disclaimer        disclaimer  make_disclaimer
    make_page   {Registration Confirmation}        confirm     make_confirm

    make_internal_page Administrivia __dwarf make_admin $conference
................................................................................
	AND   TR.talk      = T.id
	AND   TR.contact   = C.id
	AND   T.type       = TT.id
	AND   TT.text     != 'keynote'
	ORDER BY dname
    }]
}

proc ::cm::conference::md-links {links} {
    foreach {title link} $links {
	lappend lines "   * [link $title $link]"
    }
    join $lines \n
}

proc ::cm::conference::links {conference} {
    debug.cm/conference {}
    return [db do eval {
	SELECT DISTINCT title, link
	FROM   clink
	WHERE  conference = :conference
	ORDER BY title, link
    }]
}

proc ::cm::conference::talk-speakers {talk} {
    debug.cm/conference {}
    return [db do eval {
	SELECT DISTINCT dname, tag
	FROM   contact
	WHERE  id IN (SELECT contact
................................................................................

proc ::cm::conference::make_proceedings {conference} {
    debug.cm/conference {}
    upvar 1 dstdir dstdir

    set text [template use www-proceedings]
    append text \n
    append text \n [md-links $conference] \n

    set first 1
    set n 1
    db do eval {
	SELECT S.id         AS id,
	       S.title      AS title
	FROM   submission S
................................................................................
	append text |$title|$speakers|$attachments|\n
    }

    append text \n
    return $text
}

proc ::cm::conference::make_proceedings_none {conference} {
    debug.cm/conference {}

    set links [links $conference]
    if {[llength $links]} {
	lappend map @links@ [md-links $links]
	return [string map $map [template use www-proceedings.none+links]]
    } else {
	return [template use www-proceedings.none]
    }	
}

proc ::cm::conference::make_admin {conference} {
    debug.cm/conference {}
    upvar 1 dstdir dstdir

    set issues [issues [details $conference]]
................................................................................
    } else {
	db do eval {
	    INSERT OR IGNORE INTO talk_state VALUES (1,'pending');
	    INSERT OR IGNORE INTO talk_state VALUES (2,'received');
	}
    }

    if {![dbutil initialize-schema ::cm::db::do error clink {
	{
	    id		INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
	    conference	INTEGER	NOT NULL REFERENCES conference,
	    link	TEXT	NOT NULL, -- same link text can be used by multiple contacts
	    title	TEXT,
	    UNIQUE (conference, link)
	} {
	    {id		INTEGER 1 {} 1}
	    {conference	INTEGER 1 {} 0}
	    {link	TEXT    1 {} 0}
	    {title	TEXT    0 {} 0}
	} {
	    conference link
	}
    }]} {
	db setup-error link $error
    }

    
    # Shortcircuit further calls
    proc ::cm::conference::Setup {args} {}
    return
}


proc ::cm::conference::Dump {} {
................................................................................
		    < [cm dump write attachment$aid $value \
			   -encoding binary \
			   -translation binary]
	    }
	    
	    cm dump step
	}

	# (attached links)
	set first 1
	db do eval {
	    SELECT C.title AS title
	    ,      C.link  AS link
	    FROM   clink C
	    WHERE  C.conference = :id
	    ORDER BY title, link
	} {
	    if {$first} { cm dump step ; set first 0 }
	    if {$title eq $link} {
		cm dump save \
		    conference attach $link
	    } else {
		cm dump save \
		    conference attach $link $title
	    }
	}

	# booked
	set first 1
	db do eval {
	    SELECT C.dname  AS contact
	    ,      L.name   AS name
	    ,      Y.name   AS city