Check-in [c05ea3a66e]

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 contact management with 3 commands to manage links better: Rename, Title, List.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | active-on-core
Files: files | file ages | folders
SHA1:c05ea3a66edcd78dd53bdf19bcc77cf960254f4e
User & Date: aku 2017-10-11 19:09:53
Context
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
2017-09-25
17:54
Two changes: Give conferences an attribute for grouping (series), and collect materials for proceedings in a single section for convenience of download. check-in: 56c3934f39 user: aku tags: active-on-core
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/cm.tcl.

1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
....
1923
1924
1925
1926
1927
1928
1929










1930
1931
1932
1933
1934
1935



























1936
1937
1938
1939
1940
1941
1942
	    } { presence }
	    input name {
		Name of the contact to extend. No mailing lists.
	    } { optional ; interact ; validate [cm::vt contact] ; # TODO validator excluding mlists
		generate [stop!] }
	} [cm::call contact cmd_add_mail]

	private add-link {
	    section {Contact Management}
	    description {Add more links to a contact}
	    use .links
	    input name {
		Name of the contact to extend.
	    } { optional ; interact ; validate [cm::vt contact]
		generate [stop!] }
	} [cm::call contact cmd_add_link]

	private disable-mail {
	    section {Contact Management}
	    description {Disable one or more email addresses}
	    use .imails
	} [cm::call contact cmd_disable_mail]

	private hide-mail {
................................................................................
	private remove-mail {
	    section {Contact Management}
	    description {Fully remove one or more email addresses}
	    use .imails
	} [cm::call contact cmd_squash_mail]
	alias squash-mail











	private remove-link {
	    section {Contact Management}
	    description {Fully remove one or more links}
	    use .ilinks
	} [cm::call contact cmd_squash_link]




























	private disable {
	    section {Contact Management}
	    description {Disable the specified contacts}
	    input name {
		List of the contact to disable
	    } { list ; optional ; interact ; validate [cm::vt contact] }
	} [cm::call contact cmd_disable]







<
<
<
<
<
<
<
<
<
<







 







>
>
>
>
>
>
>
>
>
>






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







1886
1887
1888
1889
1890
1891
1892










1893
1894
1895
1896
1897
1898
1899
....
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
	    } { presence }
	    input name {
		Name of the contact to extend. No mailing lists.
	    } { optional ; interact ; validate [cm::vt contact] ; # TODO validator excluding mlists
		generate [stop!] }
	} [cm::call contact cmd_add_mail]











	private disable-mail {
	    section {Contact Management}
	    description {Disable one or more email addresses}
	    use .imails
	} [cm::call contact cmd_disable_mail]

	private hide-mail {
................................................................................
	private remove-mail {
	    section {Contact Management}
	    description {Fully remove one or more email addresses}
	    use .imails
	} [cm::call contact cmd_squash_mail]
	alias squash-mail

	private add-link {
	    section {Contact Management}
	    description {Add more links to a contact}
	    use .links
	    input name {
		Name of the contact to extend.
	    } { optional ; interact ; validate [cm::vt contact]
		generate [stop!] }
	} [cm::call contact cmd_add_link]

	private remove-link {
	    section {Contact Management}
	    description {Fully remove one or more links}
	    use .ilinks
	} [cm::call contact cmd_squash_link]

	private rename-link {
	    section {Contact Management}
	    description {Rename a link in all contacts using it}
	    input link {
		Name of the link to rename
	    } { validate str }
	    input new {
		New name of the link
	    } { validate str }
	} [cm::call contact cmd_rename_link]

	private set-link-title {
	    section {Contact Management}
	    description {Set the title for a link in all contacts}
	    input link {
		Name of the link to (re)title
	    } { validate str }
	    input title {
		Title for the link
	    } { validate str }
	} [cm::call contact cmd_title_link]

	private links {
	    section {Contact Management}
	    description {Show a table of the known links}
	} [cm::call contact cmd_links]

	private disable {
	    section {Contact Management}
	    description {Disable the specified contacts}
	    input name {
		List of the contact to disable
	    } { list ; optional ; interact ; validate [cm::vt contact] }
	} [cm::call contact cmd_disable]

Changes to lib/contact.tcl.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185


186
187
188
189
190
191
192
...
673
674
675
676
677
678
679







































































680
681
682
683
684
685
686
# # ## ### ##### ######## ############# ######################

# @@ Meta Begin
# Package cm::contact 0
# Meta author      {Andreas Kupries}
# Meta category    ?
# Meta description ?
# Meta location    http:/core.tcl.tk/akupries/cm
# Meta platform    tcl
# Meta require     ?
# Meta subject     ?
# Meta summary     ?
# @@ Meta End

# # ## ### ##### ######## ############# ######################
................................................................................
	cmd_create_person cmd_create_mlist cmd_create_company \
	cmd_add_mail cmd_add_link cmd_list cmd_show cmd_merge \
	cmd_set_tag cmd_set_bio cmd_hide_bio cmd_publish_bio cmd_get_bio cmd_disable \
	cmd_enable liaisons cmd_disable_mail cmd_hide_mail cmd_publish_mail \
	cmd_squash_mail cmd_squash_link cmd_mail_fix cmd_retype cmd_dead cmd_rename \
	cmd_add_company cmd_add_liaison cmd_drop_company cmd_drop_liaison \
	select label get known known-email known-type details affiliated \
	get-name get-links get-email get-link get-the-link related-formatted

    namespace ensemble create

    namespace import ::cmdr::color
    namespace import ::cmdr::ask

    namespace import ::cm::campaign
    namespace import ::cm::db
................................................................................
		}
		$t add - $display
	    }

	    # Links for the contact
	    set first 1
	    db do eval {
		SELECT link
		FROM   link
		WHERE  contact = :id
		ORDER BY link
	    } {
		if {$first} { $t add Links {} }
		set first 0
		$t add - $link


	    }

	    # Affiliations. Expected for persons, to list companies,
	    # their, well, affiliations
	    
	    set first 1
	    db do eval {
................................................................................
	    } 
	}

	puts [color good OK]
    }
    return
}








































































proc ::cm::contact::cmd_dead {config} {
    debug.cm/contact {}
    Setup
    db show-location

    foreach contact [$config @name] {







|







 







|
>







 







|







>
>







 







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







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# # ## ### ##### ######## ############# ######################

# @@ Meta Begin
# Package cm::contact 0
# Meta author      {Andreas Kupries}
# Meta category    ?
# Meta description ?
# Meta location    https://core.tcl.tk/akupries/cm
# Meta platform    tcl
# Meta require     ?
# Meta subject     ?
# Meta summary     ?
# @@ Meta End

# # ## ### ##### ######## ############# ######################
................................................................................
	cmd_create_person cmd_create_mlist cmd_create_company \
	cmd_add_mail cmd_add_link cmd_list cmd_show cmd_merge \
	cmd_set_tag cmd_set_bio cmd_hide_bio cmd_publish_bio cmd_get_bio cmd_disable \
	cmd_enable liaisons cmd_disable_mail cmd_hide_mail cmd_publish_mail \
	cmd_squash_mail cmd_squash_link cmd_mail_fix cmd_retype cmd_dead cmd_rename \
	cmd_add_company cmd_add_liaison cmd_drop_company cmd_drop_liaison \
	select label get known known-email known-type details affiliated \
	get-name get-links get-email get-link get-the-link related-formatted \
	cmd_rename_link cmd_title_link cmd_links
    namespace ensemble create

    namespace import ::cmdr::color
    namespace import ::cmdr::ask

    namespace import ::cm::campaign
    namespace import ::cm::db
................................................................................
		}
		$t add - $display
	    }

	    # Links for the contact
	    set first 1
	    db do eval {
		SELECT link, title
		FROM   link
		WHERE  contact = :id
		ORDER BY link
	    } {
		if {$first} { $t add Links {} }
		set first 0
		$t add - $link
		if {$title in [list {} $link]} continue
		$t add {} ([color name $title])
	    }

	    # Affiliations. Expected for persons, to list companies,
	    # their, well, affiliations
	    
	    set first 1
	    db do eval {
................................................................................
	    } 
	}

	puts [color good OK]
    }
    return
}

proc ::cm::contact::cmd_rename_link {config} {
    debug.cm/contact {}
    Setup
    db show-location

    set link [$config @link]
    set new  [$config @new]

    puts -nonewline "Renaming link \"[color name $link]\" to \"[color note $new]\" ... "
    flush stdout

    db do transaction {
	db do eval {
	    UPDATE link
	    SET    link = :new
	    WHERE  link = :link
	}
    }

    puts [color good OK]
    return
}

proc ::cm::contact::cmd_title_link {config} {
    debug.cm/contact {}
    Setup
    db show-location

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

    puts -nonewline "Titling link \"[color name $link]\" as \"[color note $title]\" ... "
    flush stdout

    db do transaction {
	db do eval {
	    UPDATE link
	    SET    title = :title
	    WHERE  link = :link
	}
    }

    puts [color good OK]

    return
}

proc ::cm::contact::cmd_links {config} {
    debug.cm/contact {}
    Setup
    db show-location

    # Table of links, with title, and contact it belongs to.
    
    set titles {Link Title Contact}
    [table t $titles {
	db do eval {
	    SELECT L.link  AS link
	    ,      L.title AS title
	    ,      C.dname AS contact
	    FROM link    L
	    ,    contact C
	    WHERE L.contact = C.id
	    ORDER BY L.link
	} {
	    $t add $link $title $contact
	}
    }] show
    return
}

proc ::cm::contact::cmd_dead {config} {
    debug.cm/contact {}
    Setup
    db show-location

    foreach contact [$config @name] {