Work on presentation formats. These are used in the main window as well
[ir-tcl-moved-to-github.git] / formats / medium.tcl
1 # IR toolkit for tcl/tk
2 # (c) Index Data 1995
3 # See the file LICENSE for details.
4 # Sebastian Hammer, Adam Dickmeiss
5 #
6 # $Log: medium.tcl,v $
7 # Revision 1.2  1995-06-12 15:18:10  adam
8 # Work on presentation formats. These are used in the main window as well
9 # as popup windows.
10 #
11 #
12
13 proc display-medium {sno no w hflag} {
14     if {$hflag} {
15         insertWithTags $w "\n$no\n" marc-data
16     } else {
17         $w delete 0.0 end
18     }
19     set i [z39.$sno getMarc $no field 245 * a]
20     if {$i != ""} {
21         set i [lindex $i 0]
22         insertWithTags $w "Title:      " marc-tag
23         insertWithTags $w $i marc-data
24         set i [z39.$sno getMarc $no field 245 * b]
25         if {$i != ""} {
26             insertWithTags $w [lindex $i 0] marc-data
27         }
28         $w insert end "\n"
29     }
30     set i [z39.$sno getMarc $no field 700 * a]
31     if {$i == ""} {
32         set i [z39.$sno getMarc $no field 100 * a]
33     }
34     if {$i != ""} {
35         if {[llength $i] > 1} {
36             insertWithTags $w "Authors:    " marc-tag
37         } else {
38             insertWithTags $w "Author:     " marc-tag
39         }
40         foreach x $i {
41             insertWithTags $w $x marc-data
42         }
43         $w insert end "\n"
44     }
45     set i [z39.$sno getMarc $no field 110 * *]
46     if {$i != ""} {
47         insertWithTags $w "Co-Author:  " marc-tag
48         foreach x $i {
49             insertWithTags $w $x marc-data
50         }
51         $w insert end "\n"
52     }
53
54     set i [z39.$sno getMarc $no field 650 * *]
55     if {$i != ""} {
56         set n 0
57         insertWithTags $w "Keywords:   " marc-tag
58         foreach x $i {
59             if {$n > 0} {
60                 $w insert end ", "
61             }
62             insertWithTags $w $x marc-data
63             incr n
64         }
65         $w insert end "\n"
66     }
67     set i [concat [z39.$sno getMarc $no field 260 * a] \
68             [z39.$sno getMarc $no field 260 * b]]
69     if {$i != ""} {
70         insertWithTags $w "Publisher:  " marc-tag
71         foreach x $i {
72             insertWithTags $w $x marc-data
73         }
74         $w insert end "\n"
75     }
76     set i [z39.$sno getMarc $no field 020 * a]
77     if {$i != ""} {
78         insertWithTags $w "ISBN:       " marc-tag
79         foreach x $i {
80             insertWithTags $w $x marc-data
81         }
82         $w insert end "\n"
83     }
84     set i [z39.$sno getMarc $no field 022 * a]
85     if {$i != ""} {
86         insertWithTags $w "ISSN:       " marc-tag
87         foreach x $i {
88             insertWithTags $w $x marc-data
89         }
90         $w insert end "\n"
91     }
92     set i [z39.$sno getMarc $no field 030 * a]
93     if {$i != ""} {
94         insertWithTags $w "CODEN:      " marc-tag
95         foreach x $i {
96             insertWithTags $w $x marc-data
97         }
98         $w insert end "\n"
99     }
100     set i [z39.$sno getMarc $no field 015 * a]
101     if {$i != ""} {
102         insertWithTags $w "Ctl number: " marc-tag
103         foreach x $i {
104             insertWithTags $w $x marc-data
105         }
106         $w insert end "\n"
107     }
108     set i [z39.$sno getMarc $no field 010 * a]
109     if {$i != ""} {
110         insertWithTags $w "LC number:  " marc-tag
111         foreach x $i {
112             insertWithTags $w $x marc-data
113         }
114         $w insert end "\n"
115     }
116 }