forked from ArctosDB/arctos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpecimenDetail_body.cfm
1461 lines (1445 loc) · 46.9 KB
/
SpecimenDetail_body.cfm
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
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
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
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
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
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<cfif not isdefined("toProperCase")>
<cfinclude template="/includes/_frameHeader.cfm">
</cfif>
<script src="/includes/sorttable.js"></script>
<script language="JavaScript" src="/includes/jquery/scrollTo.js" type="text/javascript"></script>
<cfoutput>
<cfif not isdefined("collection_object_id") or not isnumeric(collection_object_id)>
<div class="error">
Improper call. Aborting.....
</div>
<cfabort>
</cfif>
<cfif isdefined("session.roles") and listfindnocase(session.roles,"coldfusion_user")>
<cfset oneOfUs = 1>
<cfset isClicky = "likeLink">
<cfelse>
<cfset oneOfUs = 0>
<cfset isClicky = "">
</cfif>
<cfif oneOfUs is 0 and cgi.CF_TEMPLATE_PATH contains "/SpecimenDetail_body.cfm">
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="/SpecimenDetail.cfm?collection_object_id=#collection_object_id#">
</cfif>
<script>
jQuery(document).ready(function(){
getMedia('collecting_event','#collection_object_id#','colEventMedia','2','1');
getMedia('specimenaccn','#collection_object_id#','SpecAccnMedia','2','1');
getMedia('specimen','#collection_object_id#','specMediaDv','4','1');
});
</script>
<cfif not isdefined("seid") or seid is "undefined">
<cfset seid="">
</cfif>
<style>
.highlightSEID {
background:yellow;
}
.taxaMeta{
font-size:.8em;
color:gray;
padding-left: .5em;
text-indent:-.5em;
max-height:2.5em;
overflow:auto;
}
</style>
<cfif len(seid) gt 0>
<script>
jQuery(document).ready(function(){
$("##seidd_#seid#").addClass('highlightSEID').show();
});
</script>
</cfif>
</cfoutput>
<cfset obj = CreateObject("component","component.functions")>
<cfquery name="one" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT
collection_object_id,
cat_num,
collection_cde,
accn_id,
collection,
EnteredBy,
LASTUSER EditedBy,
entereddate,
LASTDATE,
accession,
concatEncumbranceDetails(collection_object_id) encumbranceDetail,
typestatus,
encumbrances,
COLLECTORS,
PREPARATORS,
concatCollectorAgent(#session.flatTableName#.collection_object_id,'maker') makers,
remarks,
flags,
PHYLCLASS,
KINGDOM,
PHYLUM,
PHYLORDER,
FAMILY,
GENUS,
SPECIES,
SUBSPECIES,
FORMATTED_SCIENTIFIC_NAME,
full_taxon_name,
associated_species
FROM
#session.flatTableName#
WHERE
#session.flatTableName#.collection_object_id = <cfqueryparam value = "#collection_object_id#" CFSQLType = "CF_SQL_INTEGER">
</cfquery>
<cfquery name="attribute" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
attribute_type,
attribute_value,
attribute_units,
attribute_remark,
determination_method,
determined_date,
determiner attributeDeterminer
from
v_attributes
where
<cfif not listfind(session.roles,"COLDFUSION_USER")>
is_encumbered=0 and
</cfif>
collection_object_id = <cfqueryparam value = "#collection_object_id#" CFSQLType = "CF_SQL_INTEGER">
</cfquery>
<cfquery name="rawevent" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
specimen_event.SPECIMEN_EVENT_ID,
collecting_event.collecting_event_id,
assigned_by_agent_id,
getPreferredAgentName(assigned_by_agent_id) assigned_by_agent_name,
assigned_date,
specimen_event_remark,
specimen_event_type,
COLLECTING_METHOD,
COLLECTING_SOURCE,
VERIFICATIONSTATUS,
habitat,
locality.LOCALITY_ID,
VERBATIM_DATE,
VERBATIM_LOCALITY,
COLL_EVENT_REMARKS,
BEGAN_DATE,
ENDED_DATE,
CASE
WHEN '#one.encumbrances#' LIKE '%mask coordinates%'
THEN NULL
ELSE verbatim_coordinates
END verbatim_coordinates,
collecting_event_name,
CASE
WHEN '#one.encumbrances#' LIKE '%mask coordinates%'
THEN NULL
ELSE locality.DEC_LAT
END DEC_LAT,
CASE
WHEN '#one.encumbrances#' LIKE '%mask coordinates%'
THEN NULL
ELSE locality.DEC_LONG
END DEC_LONG,
collecting_event.DATUM,
collecting_event.ORIG_LAT_LONG_UNITS,
geog_auth_rec.GEOG_AUTH_REC_ID,
geog_auth_rec.SOURCE_AUTHORITY,
SPEC_LOCALITY,
MINIMUM_ELEVATION,
MAXIMUM_ELEVATION,
ORIG_ELEV_UNITS,
MIN_DEPTH,
MAX_DEPTH,
DEPTH_UNITS,
MAX_ERROR_DISTANCE,
MAX_ERROR_UNITS,
LOCALITY_REMARKS,
georeference_source,
georeference_protocol,
locality_name,
higher_geog,
geog_auth_rec.SOURCE_AUTHORITY,
geog_search_term.SEARCH_TERM
from
specimen_event,
collecting_event,
locality,
geog_auth_rec,
geog_search_term
where
specimen_event.collecting_event_id=collecting_event.collecting_event_id and
collecting_event.locality_id=locality.locality_id and
locality.geog_auth_rec_id=geog_auth_rec.geog_auth_rec_id and
geog_auth_rec.geog_auth_rec_id=geog_search_term.geog_auth_rec_id (+) and
specimen_event.specimen_event_type != 'unaccepted place of collection' and
specimen_event.collection_object_id=<cfqueryparam value = "#collection_object_id#" CFSQLType = "CF_SQL_INTEGER">
order by
specimen_event_type
</cfquery>
<cfquery name="event" dbtype="query">
select
SPECIMEN_EVENT_ID,
collecting_event_id,
assigned_by_agent_id,
assigned_by_agent_name,
assigned_date,
specimen_event_remark,
specimen_event_type,
COLLECTING_METHOD,
COLLECTING_SOURCE,
VERIFICATIONSTATUS,
habitat,
LOCALITY_ID,
VERBATIM_DATE,
VERBATIM_LOCALITY,
COLL_EVENT_REMARKS,
BEGAN_DATE,
ENDED_DATE,
verbatim_coordinates,
collecting_event_name,
DEC_LAT,
DEC_LONG,
DATUM,
ORIG_LAT_LONG_UNITS,
GEOG_AUTH_REC_ID,
SOURCE_AUTHORITY,
SPEC_LOCALITY,
MINIMUM_ELEVATION,
MAXIMUM_ELEVATION,
ORIG_ELEV_UNITS,
MIN_DEPTH,
MAX_DEPTH,
DEPTH_UNITS,
MAX_ERROR_DISTANCE,
MAX_ERROR_UNITS,
LOCALITY_REMARKS,
georeference_source,
georeference_protocol,
locality_name,
higher_geog,
SOURCE_AUTHORITY
from
rawevent
group by
SPECIMEN_EVENT_ID,
collecting_event_id,
assigned_by_agent_id,
assigned_by_agent_name,
assigned_date,
specimen_event_remark,
specimen_event_type,
COLLECTING_METHOD,
COLLECTING_SOURCE,
VERIFICATIONSTATUS,
habitat,
LOCALITY_ID,
VERBATIM_DATE,
VERBATIM_LOCALITY,
COLL_EVENT_REMARKS,
BEGAN_DATE,
ENDED_DATE,
verbatim_coordinates,
collecting_event_name,
DEC_LAT,
DEC_LONG,
DATUM,
ORIG_LAT_LONG_UNITS,
GEOG_AUTH_REC_ID,
SOURCE_AUTHORITY,
SPEC_LOCALITY,
MINIMUM_ELEVATION,
MAXIMUM_ELEVATION,
ORIG_ELEV_UNITS,
MIN_DEPTH,
MAX_DEPTH,
DEPTH_UNITS,
MAX_ERROR_DISTANCE,
MAX_ERROR_UNITS,
LOCALITY_REMARKS,
georeference_source,
georeference_protocol,
locality_name,
higher_geog,
SOURCE_AUTHORITY
</cfquery>
<style>
.acceptedIdDiv {
border:1px dotted green;
}
.unAcceptedIdDiv{
border:1px dotted gray;
background-color:#F8F8F8;
color:gray;
font-size:.8em;
}
.taxDetDiv {
padding-left:1em;
}
.sddoi {
font-size: smaller;
}
</style>
<cfset obj = CreateObject("component","component.functions")>
<cfoutput query="one">
<cfif oneOfUs is 1>
<form name="editStuffLinks" method="post" action="SpecimenDetail.cfm">
<input type="hidden" name="collection_object_id" value="#one.collection_object_id#">
<input type="hidden" name="suppressHeader" value="true">
<input type="hidden" name="action" value="nothing">
<input type="hidden" name="Srch" value="Part">
</cfif>
<table width="95%" cellpadding="0" cellspacing="0"><!---- full page table ---->
<tr>
<td valign="top" width="50%">
<!------------------------------------ Taxonomy ---------------------------------------------->
<div class="detailCell">
<div class="detailLabel">
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('editIdentification');">Edit</span>
</cfif>
</div>
<div class="detailBlock">
<span class="detailData">
<cfquery name="raw_identification" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT
identification.scientific_name,
concatidagent(identification.identification_id) agent_name,
made_date,
nature_of_id,
identification_remarks,
identification.identification_id,
accepted_id_fg,
taxa_formula,
short_citation,
identification.publication_id,
taxon_name.scientific_name taxsciname,
common_name.common_name
FROM
identification,
publication,
identification_taxonomy,
taxon_name,
common_name
WHERE
identification.publication_id=publication.publication_id (+) and
identification.identification_id=identification_taxonomy.identification_id (+) and
identification_taxonomy.taxon_name_id=taxon_name.taxon_name_id (+) and
identification_taxonomy.taxon_name_id=common_name.taxon_name_id (+) and
identification.collection_object_id = #collection_object_id#
</cfquery>
<cfquery name="identification" dbtype="query">
select
scientific_name,
agent_name,
made_date,
nature_of_id,
identification_remarks,
identification_id,
accepted_id_fg,
taxa_formula,
short_citation,
publication_id
from
raw_identification
group by
scientific_name,
agent_name,
made_date,
nature_of_id,
identification_remarks,
identification_id,
accepted_id_fg,
taxa_formula,
short_citation,
publication_id
ORDER BY accepted_id_fg DESC,made_date DESC
</cfquery>
<cfloop query="identification">
<cfif accepted_id_fg is 1>
<div class="acceptedIdDiv">
<cfelse>
<div class="unAcceptedIdDiv">
</cfif>
<cfquery name="thisTaxLinks" dbtype="query">
select distinct taxsciname from raw_identification where identification_id=#identification_id#
</cfquery>
<cfquery name="thisCommonName" dbtype="query">
select distinct common_name from raw_identification where common_name is not null and
identification_id=#identification_id#
order by common_name
</cfquery>
<cfset link="">
<cfset i=1>
<cfset thisSciName="#scientific_name#">
<cfloop query="thisTaxLinks">
<cfset thisLink='<a href="/name/#taxsciname#" target="_blank">#taxsciname#</a>'>
<cfset thisSciName=#replace(thisSciName,taxsciname,thisLink)#>
<cfset i=i+1>
</cfloop>
#thisSciName#
<cfif not isdefined("metaDesc")>
<cfset metaDesc="">
</cfif>
<div class="taxDetDiv">
<cfif accepted_id_fg is 1>
<div class="taxaMeta">
#one.full_taxon_name#
</div>
</cfif>
<cfif thisCommonName.recordcount gt 0>
<div class="taxaMeta">
#valuelist(thisCommonName.common_name,'; ')#
</div>
</cfif>
<cfif len(short_citation) gt 0>
sensu <a href="/publication/#publication_id#" target="_mainFrame">
#short_citation#
</a><br>
</cfif>
Identified by #agent_name#
<cfif len(made_date) gt 0>
on #made_date#
</cfif>
<br>Nature of ID: #nature_of_id#
<cfif len(identification_remarks) gt 0>
<br>Remarks: #identification_remarks#
</cfif>
</div>
</div>
</cfloop>
</span>
</div>
</div>
<!------------------------------------ citations ---------------------------------------------->
<cfif len(one.typestatus) gt 0>
<cfquery name="raw_citations" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
citation.CITATION_ID,
citation.PUBLICATION_ID,
citation.type_status,
identification.scientific_name idsciname,
citation.CITATION_REMARKS,
taxon_name.scientific_name taxsciname,
publication.short_citation,
citation.OCCURS_PAGE_NUMBER,
media.preview_uri,
media.media_type,
media.media_uri,
media.media_id,
publication.doi
FROM
citation,
identification,
publication,
identification_taxonomy,
taxon_name,
(select * from media_relations where media_relationship='shows publication') media_relations,
media
WHERE
citation.identification_id=identification.identification_id AND
citation.publication_id=publication.publication_id AND
identification.identification_id=identification_taxonomy.identification_id and
identification_taxonomy.taxon_name_id=taxon_name.taxon_name_id and
publication.publication_id = media_relations.related_primary_key (+) and
media_relations.media_id=media.media_id (+) and
citation.collection_object_id=#collection_object_id#
</cfquery>
<cfquery name="citations" dbtype="query">
select
PUBLICATION_ID,
type_status,
idsciname,
short_citation,
OCCURS_PAGE_NUMBER,
CITATION_ID,
CITATION_REMARKS,
doi
from
raw_citations
group by
PUBLICATION_ID,
type_status,
idsciname,
short_citation,
OCCURS_PAGE_NUMBER,
CITATION_ID,
CITATION_REMARKS,
doi
</cfquery>
<div class="detailCell">
<div class="detailLabel">Citations</div>
<cfloop query="citations">
<cfquery name="thisTaxLinks" dbtype="query">
select distinct taxsciname from raw_citations where citation_id=#citation_id# and
taxsciname is not null
</cfquery>
<cfset thisSciName="#idsciname#">
<cfloop query="thisTaxLinks">
<cfset thisLink='<a href="/name/#taxsciname#" target="_blank">#taxsciname#</a>'>
<cfset thisSciName=#replace(thisSciName,taxsciname,thisLink)#>
<cfset i=i+1>
</cfloop>
<cfquery name="thisPubsMedia" dbtype="query">
select distinct preview_uri,media_type,media_uri,media_id from
raw_citations where media_id is not null and citation_id=#citation_id#
</cfquery>
<div class="detailBlock">
#type_status# of #thisSciName#
<cfif len(OCCURS_PAGE_NUMBER) gt 0>, page #OCCURS_PAGE_NUMBER#</cfif>
in <a href="#Application.serverRootURL#/publication/#PUBLICATION_ID#">#short_citation#</a>
<cfloop query="thisPubsMedia">
<cfset mp = obj.getMediaPreview(
preview_uri="#preview_uri#",
media_type="#media_type#")>
<a href="/media/#media_id#?open" target="_blank"><img src="#mp#" class="smallMediaPreview"></a>
</cfloop>
<cfif len(doi) gt 0>
<a href="http://dx.doi.org/#doi#" target="_blank" class="external sddoi">DOI:#doi#</a>
</cfif>
<cfif len(CITATION_REMARKS) gt 0>
<div class="detailCellSmall">
#CITATION_REMARKS#
</div>
</cfif>
</div>
</cfloop>
</div>
</cfif>
<!------------------------------------ locality ---------------------------------------------->
<div class="detailCell">
<div class="detailLabel">
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('specLocality');">Edit</span>
</cfif>
</div>
<cfloop query="event">
<div style="border:1px solid green; margin:1em;">
<div id="seidd_#specimen_event_id#" style="display:none;font-size:xx-small;">
OccurrenceID: #Application.serverRootURL#/guid/#guid#?seid=#specimen_event_id#
</div>
<table id="SD_#specimen_event_id#">
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Determination Type:</td>
<td id="SDCellRight">#specimen_event_type#</td>
</tr>
<tr>
<td></td>
<td id="SDCellRight" class="detailCellSmall">
assigned by #assigned_by_agent_name# on #dateformat(assigned_date,'yyyy-mm-dd')#
</td>
</tr>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Higher Geography:</td>
<td id="SDCellRight">
<cfif left(source_authority,4) is "http">
<a href="#source_authority#" target="_blank" class="external">#higher_geog#</a>
<cfelse>
#higher_geog#
</cfif>
<cfquery name="geosrchterms" dbtype="query">
select search_term from rawevent where specimen_event_id=#specimen_event_id# group by search_term order by search_term
</cfquery>
<div style="margin-left:1em;max-height:3em;overflow:auto;" class="detailBlock">
<cfloop query='geosrchterms'>
<div class="detailCellSmall">#search_term#</div>
</cfloop>
</div>
</td>
</tr>
<cfif verbatim_locality is not spec_locality>
<cfif len(verbatim_locality) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Verbatim Locality:</td>
<td id="SDCellRight">#verbatim_locality#
</td>
</tr>
</cfif>
</cfif>
<cfif len(locality_name) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Locality Nickname:</td>
<td id="SDCellRight">#locality_name#</td>
</tr>
</cfif>
<cfif len(collecting_event_name) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Event Nickname:</td>
<td id="SDCellRight">#collecting_event_name#</td>
</tr>
</cfif>
<cfif len(spec_locality) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Specific Locality:</td>
<td id="SDCellRight">
#spec_locality#
</td>
</tr>
</cfif>
<cfif len(specimen_event_remark) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Specimen/Event Remarks:</td>
<td id="SDCellRight">#specimen_event_remark#</td>
</tr>
</cfif>
<cfif len(COLL_EVENT_REMARKS) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Event Remarks:</td>
<td id="SDCellRight">#COLL_EVENT_REMARKS#</td>
</tr>
</cfif>
<cfif len(LOCALITY_REMARKS) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Locality Remarks:</td>
<td id="SDCellRight">#LOCALITY_REMARKS#</td>
</tr>
</cfif>
<cfif len(habitat) gt 0>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Habitat:</td>
<td id="SDCellRight">#habitat#</td>
</tr>
</cfif>
<cfif len(collecting_method) gt 0>
<div class="detailBlock">
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Collecting Method:</td>
<td id="SDCellRight">#collecting_method#</td>
</tr>
</div>
</cfif>
<cfif len(collecting_source) gt 0>
<div class="detailBlock">
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Collecting Source:</td>
<td id="SDCellRight">#collecting_source#</td>
</tr>
</div>
</cfif>
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Event Date:</td>
<td id="SDCellRight">#began_date#<cfif ended_date neq began_date> to #ended_date#</cfif></td>
</tr>
<tr>
<td></td>
<td id="SDCellRight" class="detailCellSmall">
Verbatim Date: #verbatim_date#
</td>
</tr>
<cfif len(VERIFICATIONSTATUS) gt 0>
<div class="detailBlock">
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Verification Status:</td>
<td id="SDCellRight">#VERIFICATIONSTATUS#</td>
</tr>
</div>
</cfif>
<cfif len(one.associated_species) gt 0>
<div class="detailBlock">
<tr class="detailData">
<td id="SDCellLeft" class="innerDetailLabel">Associated Species:</td>
<td id="SDCellRight">#one.associated_species#</td>
</tr>
</div>
</cfif>
<tr>
<td colspan="2">
<table width="100%">
<tr>
<td valign="top" align="right"><!---- text stuff here ---->
<table>
<cfif len(dec_lat) gt 0 and len(dec_long) gt 0>
<tr>
<td align="right" valign="top">Coordinates:</td>
<td align="left">
#dec_lat# / #dec_long#
<cfif len(verbatim_coordinates) gt 0>
<div class="detailCellSmall">
Verbatim Coordinates: #verbatim_coordinates#
</div>
</cfif>
<cfif len(DATUM) gt 0>
<div style="font-size:.8em;">
Datum: #DATUM#
</div>
</cfif>
<cfif len(MAX_ERROR_UNITS) gt 0>
<div style="font-size:.8em;">Error: #MAX_ERROR_DISTANCE# #MAX_ERROR_UNITS#</div>
</cfif>
<cfif len(georeference_source) gt 0>
<div style="font-size:.8em;">Georeference Source: #georeference_source#</div>
</cfif>
<cfif len(georeference_protocol) gt 0>
<div style="font-size:.8em;">Georeference Protocol: #georeference_protocol#</div>
</cfif>
</td>
</tr>
</cfif>
<cfif len(orig_elev_units) gt 0>
<tr>
<td align="right">Elevation</td>
<td align="left">#minimum_elevation# to #maximum_elevation# #orig_elev_units#</td>
</tr>
</cfif>
<cfif len(DEPTH_UNITS) gt 0>
<tr>
<td align="right">Depth:</td>
<td align="left">#MIN_DEPTH# to #MAX_DEPTH# #DEPTH_UNITS#</td>
</tr>
</cfif>
</table>
</td>
<td valign="top" align="right"><!---- map here --->
<cfif len(dec_lat) gt 0 and len(dec_long) gt 0>
<div id="mapgohere-locality_id-#locality_id#"></div>
<!----
<cfinvoke component="component.functions" method="getMap" returnvariable="contents">
<cfinvokeargument name="locality_id" value="#locality_id#">
</cfinvoke>
#contents#
---->
</cfif>
</td>
</tr>
<tr>
<td valign="top" align="right"><!---- map here ---><div id="colEventMedia"></div></td>
</tr>
</table>
</td>
</tr>
<cfquery name="geology" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select * from
geology_attributes,
preferred_agent_name
where
geology_attributes.GEO_ATT_DETERMINER_ID=preferred_agent_name.agent_id (+) and
locality_id=#locality_id#
</cfquery>
<cfloop query="geology">
<tr>
<td id="SDCellLeft" class="innerDetailLabel">#GEOLOGY_ATTRIBUTE#:</td>
<td id="SDCellRight">
#GEO_ATT_VALUE#
</td>
</tr>
<tr>
<td></td>
<td id="SDCellRight" class="detailCellSmall">
Determined by
<cfif len(agent_name) gt 0>
#agent_name#
<cfelse>
unknown
</cfif>
<cfif len(GEO_ATT_DETERMINED_DATE) gt 0>
on #dateformat(GEO_ATT_DETERMINED_DATE,"yyyy-mm-dd")#
</cfif>
<cfif len(GEO_ATT_DETERMINED_METHOD) gt 0>
Method: #GEO_ATT_DETERMINED_METHOD#
</cfif>
<cfif len(GEO_ATT_REMARK) gt 0>
Remark: #GEO_ATT_REMARK#
</cfif>
</td>
</tr>
</cfloop>
</table>
</div>
</cfloop>
</div>
<!------------------------------------ collectors ---------------------------------------------->
<div class="detailCell">
<div class="detailLabel">Collector(s)
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('editColls');">Edit</span>
</cfif>
</div>
<div class="detailBlock">
<span class="detailData">
<span class="innerDetailLabel"></span>
#collectors#
</span>
</div>
</div>
<!------------------------------------ preparators ---------------------------------------------->
<cfif len(preparators) gt 0>
<div class="detailCell">
<div class="detailLabel">Preparator(s)
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('editColls');">Edit</span>
</cfif>
</div>
<div class="detailBlock">
<span class="detailData">
<span class="innerDetailLabel"></span>
#preparators#
</span>
</div>
</div>
</cfif>
<!------------------------------------ makers ---------------------------------------------->
<cfif len(makers) gt 0>
<div class="detailCell">
<div class="detailLabel">Maker(s)
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('editColls');">Edit</span>
</cfif>
</div>
<div class="detailBlock">
<span class="detailData">
<span class="innerDetailLabel"></span>
#makers#
</span>
</div>
</div>
</cfif>
<cfquery name="isProj" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT project_name, project.project_id project_id FROM
project, project_trans
WHERE
project_trans.project_id = project.project_id AND
project_trans.transaction_id=#one.accn_id#
GROUP BY project_name, project.project_id
</cfquery>
<cfquery name="isLoan" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT project_name, project.project_id FROM
loan_item,
project,
project_trans,
specimen_part
WHERE
specimen_part.derived_from_cat_item = #one.collection_object_id# AND
loan_item.transaction_id=project_trans.transaction_id AND
project_trans.project_id=project.project_id AND
specimen_part.collection_object_id = loan_item.collection_object_id
GROUP BY
project_name, project.project_id
</cfquery>
<cfquery name="isLoanedItem" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT
loan_item.collection_object_id
FROM
loan_item,
specimen_part
WHERE
loan_item.collection_object_id=specimen_part.collection_object_id AND
specimen_part.derived_from_cat_item=#one.collection_object_id#
UNION
SELECT
loan_item.collection_object_id
FROM
loan_item
WHERE
loan_item.collection_object_id=#one.collection_object_id#
</cfquery>
</td>
<td valign="top" width="50%">
<!------------------------------------ identifiers ---------------------------------------------->
<cfquery name="oid" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT
coll_obj_other_id_num.COLL_OBJ_OTHER_ID_NUM_ID,
case when #oneOfUs# != 1 and
concatencumbrances(coll_obj_other_id_num.collection_object_id) like '%mask original field number%' and
coll_obj_other_id_num.other_id_type = 'original identifier'
then 'Masked'
else
coll_obj_other_id_num.display_value
end display_value,
coll_obj_other_id_num.other_id_type,
coll_obj_other_id_num.id_references,
case when base_url is not null then
ctcoll_other_id_type.base_url || coll_obj_other_id_num.display_value
else
null
end link
FROM
coll_obj_other_id_num,
ctcoll_other_id_type
where
collection_object_id=#one.collection_object_id# and
coll_obj_other_id_num.other_id_type=ctcoll_other_id_type.other_id_type (+)
</cfquery>
<cfquery name="ids" dbtype="query">
select * from oid where id_references='self' order by other_id_type
</cfquery>
<cfif len(ids.other_id_type) gt 0>
<div class="detailCell" style="max-height:200px;overflow:auto;">
<div class="detailLabel">Identifiers
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('editIdentifiers');">Edit</span>
</cfif>
</div>
<cfloop query="ids">
<div class="detailBlock">
<span class="innerDetailLabel">
#other_id_type#:
</span>
<cfif len(link) gt 0>
<a class="external" href="#link#" target="_blank">#display_value#</a>
<cfelse>
#display_value#
</cfif>
</div>
</cfloop>
</div>
</cfif>
<cfquery name="rels" dbtype="query">
select * from oid where id_references != 'self' order by id_references,other_id_type
</cfquery>
<cfif len(rels.other_id_type) gt 0>
<div class="detailCell" id="relationshipsCell" style="max-height:200px;overflow:auto;">
<div class="detailLabel">Relationships
<cfif oneOfUs is 1>
<span class="detailEditCell" onclick="window.parent.loadEditApp('editIdentifiers');">Edit</span>
</cfif>
</div>
<cfloop query="rels">
<cfquery name="relcache" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select * from cf_relations_cache where COLL_OBJ_OTHER_ID_NUM_ID=#COLL_OBJ_OTHER_ID_NUM_ID# order by term
</cfquery>
<cfset thisClass="">
<cfif id_references is "same individual as">
<script>
$("body").addClass("isDuplicateRecord");
</script>
<cfset thisClass="isDuplicateRecord">
</cfif>
<div class="detailBlock #thisClass#">
<span class="innerDetailLabel">
(<i>#id_references#</i>)
</span>
<cfif len(link) gt 0>
<a class="external" href="#link#" target="_blank">#other_id_type#:#display_value#</a>
<cfelse>
#other_id_type#:#display_value#
</cfif>
<div class="relCacheDiv">
<cfloop query="relcache">
<div class="indivRelCacheTerm">
#TERM#@#dateformat(CACHEDATE,"yyyy-mm-dd")#: #VALUE#
</div>
</cfloop>
</div>
</div>
</cfloop>
</div>
</cfif>
<!------------------------------------ parts ---------------------------------------------->
<cfquery name="rparts" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
specimen_part.collection_object_id part_id,
pc.label,
part_name,
sampled_from_obj_id,
coll_object.COLL_OBJ_DISPOSITION part_disposition,
coll_object.CONDITION part_condition,
lot_count,
coll_object_remarks part_remarks,
attribute_type,
attribute_value,
attribute_units,
determined_date,
attribute_remark,
agent_name
from
specimen_part,
coll_object,
coll_object_remark,
coll_obj_cont_hist,
container oc,
container pc,
specimen_part_attribute,
preferred_agent_name
where
specimen_part.collection_object_id=specimen_part_attribute.collection_object_id (+) and
specimen_part_attribute.determined_by_agent_id=preferred_agent_name.agent_id (+) and
specimen_part.collection_object_id=coll_object.collection_object_id and
coll_object.collection_object_id=coll_obj_cont_hist.collection_object_id and
coll_object.collection_object_id=coll_object_remark.collection_object_id (+) and
coll_obj_cont_hist.container_id=oc.container_id and
oc.parent_container_id=pc.container_id (+) and
specimen_part.derived_from_cat_item=#one.collection_object_id#
</cfquery>
<cfquery name="parts" dbtype="query">
select
part_id,
label,
part_name,
sampled_from_obj_id,
part_disposition,
part_condition,
lot_count,
part_remarks
from
rparts
group by
part_id,
label,
part_name,
sampled_from_obj_id,
part_disposition,
part_condition,
lot_count,
part_remarks
order by
part_name