forked from ArctosDB/arctos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocality.cfm
1968 lines (1921 loc) · 71.6 KB
/
Locality.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
<cfinclude template="includes/_header.cfm">
<script src="/includes/sorttable.js"></script>
<cf_customizeIFrame>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function() {
$("#began_date").datepicker();
$("#ended_date").datepicker();
});
function addGeoSrchTerm(){
var n,h;
n=parseInt($("#numGeogSrchTerms").val()) + 1;
h='<tr id="gst' + n + '"><td colspan="4">';
h+='<textarea name="new_geog_search_term_' + n + '" id="new_geog_search_term_' + n + '" class="longtextarea newRec" rows="30" cols="1"></textarea>'
h+='</td></tr>';
$( "#gst" + $("#numGeogSrchTerms").val()).after( h );
$("#numGeogSrchTerms").val(n);
}
</script>
<cfoutput>
<!--- see if action is duplicated --->
<cfif action contains ",">
<cfset i=1>
<cfloop list="#action#" delimiters="," index="a">
<cfif i is 1>
<cfset firstAction = a>
<cfelse>
<cfif a neq firstAction>
An error has occured! Multiple Action in Locality. Please submit a bug report.
<cfabort>
</cfif>
</cfif>
</cfloop>
<cfset action = firstAction>
</cfif>
<cfif isdefined("collection_object_id") AND collection_object_id gt 0 AND action is "nothing">
<!--- probably got here from SpecimenDetail, make sure we're in a frame --->
<script>
var thePar = parent.location.href;
var isFrame = thePar.indexOf('Locality.cfm');
if (isFrame == -1) {
// we're in a frame, action is NOTHING, we have a collection_object_id; redirect to
// get a collecting_event_id
//alert('in a frame');
document.location='Locality.cfm?action=findCollEventIdForSpecDetail&collection_object_id=#collection_object_id#';
}
</script>
</cfif>
<cfif action is "massEditCollEvent">
<cfquery name="locality" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
SPEC_LOCALITY,
DEC_LAT,
DEC_LONG,
DATUM
from locality where locality_id=#locality_id#
</cfquery>
<cfquery name="events" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
count(*) c,
VERBATIM_DATE,
VERBATIM_LOCALITY,
VERBATIM_COORDINATES,
COLLECTING_EVENT_NAME
from
collecting_event
where
locality_id=#locality_id#
group by
VERBATIM_DATE,
VERBATIM_LOCALITY,
VERBATIM_COORDINATES,
COLLECTING_EVENT_NAME
</cfquery>
Updating events used in verified specimen-events will fail. (You can mass-update verificationstatus from edit event.)
<p>
Use this form to update all specimens in the table below to the locality coordinates. If you need more control, use other tools.
</p>
<p>
If you aren't absolutely sure what this form does, find out before clicking anything.
</p>
<p>Locality:</p>
<ul>
<li>Locality_ID: #locality_id#</li>
<li>SPEC_LOCALITY: #locality.SPEC_LOCALITY#</li>
<li>DEC_LAT: #locality.DEC_LAT#</li>
<li>DEC_LONG: #locality.DEC_LONG#</li>
<li>DATUM: #locality.DATUM#</li>
</ul>
<label for="et">Events using this Locality</label>
<table id="et" border>
<tr>
<th>Count</th>
<th>Nickname</th>
<th>Date</th>
<th>Coordinates</th>
</tr>
<cfloop query="events">
<tr>
<td>#c#</td>
<td>#COLLECTING_EVENT_NAME#</td>
<td>#VERBATIM_DATE#</td>
<td>#verbatim_coordinates#</td>
</tr>
</cfloop>
</table>
<input type="button" value="Continue to update all events to these locality coordinates" class="savBtn"
onclick="document.location='/Locality.cfm?action=reallyMassEditCollEvent&locality_id=#locality_id#'">
</cfif>
<cfif action is "reallyMassEditCollEvent">
<cfquery name="reallyMassEditCollEvent" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
update collecting_event set
( ORIG_LAT_LONG_UNITS, DEC_LAT, DEC_LONG, DATUM)
= (select 'decimal degrees', DEC_LAT, DEC_LONG, DATUM from locality where locality_id=#locality_id#)
where locality_id=#locality_id#
</cfquery>
<cflocation addtoken="false" url="editLocality.cfm?locality_id=#locality_id#">
</cfif>
<cfif action is "findCollEventIdForSpecDetail">
<!--- get a collecting event ID and relocate to editCollEvnt --->
<cfquery name="ceid" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select collecting_event_id from cataloged_item where
collection_object_id=#collection_object_id#
</cfquery>
<cflocation url="Locality.cfm?action=editCollEvnt&collecting_event_id=#ceid.collecting_event_id#">
</cfif>
</cfoutput>
<cfif not isdefined("collection_object_id")>
<cfset collection_object_id=-1>
</cfif>
<cfif not isdefined("anchor")>
<cfset anchor="">
</cfif>
<!--------------------------- Code-table queries -------------------------------------------------->
<cfquery name="ctIslandGroup" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select island_group from ctisland_group order by island_group
</cfquery>
<cfquery name="ctElevUnit" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select orig_elev_units from ctorig_elev_units order by orig_elev_units
</cfquery>
<cfquery name="ctCollecting_Source" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select collecting_source from ctCollecting_Source order by collecting_source
</cfquery>
<cfquery name="ctFeature" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select distinct(feature) from ctfeature order by feature
</cfquery>
<cfquery name="ctGeorefMethod" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select georefMethod from ctgeorefmethod order by georefMethod
</cfquery>
<cfquery name="ctVerificationStatus" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select VerificationStatus from ctVerificationStatus order by VerificationStatus
</cfquery>
<cfquery name="ctlat_long_units" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select ORIG_LAT_LONG_UNITS from ctlat_long_units order by ORIG_LAT_LONG_UNITS
</cfquery>
<cfquery name="ctdatum" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select datum from ctdatum order by datum
</cfquery>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "nothing">
<cfoutput>
<cfset title="Manage Localities">
<table border>
<tr>
<td>Higher Geography</td>
<td>
<form name="nothing" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="findHG">
<input type="submit" value="Find" class="lnkBtn">
</form>
</td>
<td>
<form name="nothing" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="newHG">
<input type="submit" value="New Higher Geog" class="insBtn">
</form>
</td>
<td>
<!---<a href="javascript:void(0);" onClick="getDocs('higher_geography')"><img src="/images/what.gif" border="0"></a>--->
<span class="infoLink" onclick="getDocs('higher_geography');">Define</span>
</td>
</tr>
<tr>
<td>Localities</td>
<td>
<form name="nothing" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="findLO">
<input type="submit" value="Find" class="lnkBtn">
</form>
</td>
<td>
<form name="nothing" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="newLocality">
<input type="submit" value="New Locality" class="insBtn">
</form>
</td>
<td>
<span class="infoLink" onclick="getDocs('locality');">Define</span>
</td>
</tr>
<tr>
<td>Collecting Events</td>
<td>
<form name="nothing" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="findCO">
<input type="submit" value="Find" class="lnkBtn">
</form>
</td>
<td>(Find and clone to create new)</td>
<td>
<span class="infoLink" onclick="getDocs('collecting_event');">Define</span>
</td>
</tr>
</table>
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "findHG">
<cfoutput>
<cfset title="Find Geography">
<strong>Find Higher Geography:</strong>
<form name="getCol" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="findGeog">
<cfinclude template="/includes/frmFindLocation_guts.cfm">
</form>
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "newHG">
<cfoutput>
<cfset title="Create Higher Geography">
<b>Create Higher Geography:</b>
<cfform name="getHG" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="makeGeog">
<table>
<tr>
<td align="right">Continent or Ocean:</td>
<td>
<input type="text" name="continent_ocean" <cfif isdefined("continent_ocean")> value = "#continent_ocean#"</cfif>>
</td>
</tr>
<tr>
<td align="right">Country:</td>
<td>
<input type="text" name="country" <cfif isdefined("country")> value = "#country#"</cfif>>
</td>
</tr>
<tr>
<td align="right">State:</td>
<td>
<input type="text" name="state_prov" <cfif isdefined("state_prov")> value = "#state_prov#"</cfif>>
</td>
</tr>
<tr>
<td align="right">County:</td>
<td>
<input type="text" name="county" <cfif isdefined("county")> value = "#county#"</cfif>>
</td>
</tr>
<tr>
<td align="right">Quad:</td>
<td>
<input type="text" name="quad" <cfif isdefined("quad")> value = "#quad#"</cfif>>
</td>
</tr>
<tr>
<td align="right">Feature:</td>
<td>
<cfif isdefined("feature")>
<cfset thisFeature = feature>
<cfelse>
<cfset thisFeature = "">
</cfif>
<select name="feature">
<option value=""></option>
<cfloop query="ctFeature">
<option
<cfif thisFeature is ctFeature.feature> selected="selected" </cfif>
value = "#ctFeature.feature#">#ctFeature.feature#</option>
</cfloop>
</select>
</td>
</tr>
<tr>
<td align="right">Island Group:</td>
<td>
<cfif isdefined("island_group")>
<cfset islandgroup=island_group>
<cfelse>
<cfset islandgroup=''>
</cfif>
<select name="island_group" size="1">
<option value=""></option>
<cfloop query="ctIslandGroup">
<option <cfif ctIslandGroup.island_group is islandgroup> selected="selected" </cfif>
value="#ctIslandGroup.island_group#">#ctIslandGroup.island_group#
</option>
</cfloop>
</select></td>
</tr>
<tr>
<td align="right">Island:</td>
<td>
<input type="text" name="island" <cfif isdefined("island")> value = "#island#"</cfif> size="50">
</td>
</tr>
<tr>
<td align="right">Sea:</td>
<td>
<input type="text" name="sea" <cfif isdefined("sea")> value = "#sea#"</cfif>>
</td>
</tr>
<tr>
<td align="right">Source Authority (Wikipedia URL)</td>
<td>
<input name="source_authority" id="source_authority" class="reqdClr">
</td>
</tr>
<tr>
<td colspan="2">
<label for="geog_remark">Remarks (why is this unique, how is it different from similar values, etc.)</label>
<textarea name="geog_remark" id="geog_remark" class="hugetextarea" rows="60" cols="10"></textarea> </td>
</tr><tr>
<td colspan="2">
<input type="submit" value="Create" class="insBtn">
<input type="button" value="Quit" class="qutBtn" onclick="document.location='Locality.cfm';">
</td>
</tr>
</table>
</cfform>
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "findLO">
<cfoutput>
<cfset title="Find Locality">
<cfset showLocality=1>
<strong>Find Locality:</strong>
<form name="getCol" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="findLocality">
<cfinclude template="/includes/frmFindLocation_guts.cfm">
</form>
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "findCO">
<cfoutput>
<cfset title="Find Collecting Events">
<cfset showLocality=1>
<cfset showEvent=1>
<strong>Find Collecting Events:</strong>
<form name="getCol" method="post" action="Locality.cfm">
<input type="hidden" name="Action" value="findCollEvent">
<cfinclude template="/includes/frmFindLocation_guts.cfm">
</form>
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "editGeog">
<script>
function clearTerm(id){
$("#" + id).val('');
}
function asterisckificateisland(){
$("#island").val("*" + $("#island").val());
}
</script>
<cfset title = "Edit Geography">
<cfoutput>
<cfquery name="geogDetails" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select * from geog_auth_rec where geog_auth_rec_id = #geog_auth_rec_id#
</cfquery>
<h3>Edit Higher Geography</h3>
<span class="infoLink" onClick="getDocs('higher_geography')">help</span>
<cfquery name="localities" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select count(*) c from locality where geog_auth_rec_id=#geog_auth_rec_id#
</cfquery>
<cfquery name="collecting_events" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select count(*) c from locality,collecting_event
where
locality.locality_id = collecting_event.locality_id AND
geog_auth_rec_id=#geog_auth_rec_id#
</cfquery>
<cfquery name="specimen" datasource="uam_god">
select
collection.collection_id,
collection.guid_prefix,
count(*) c
from
locality,
collecting_event,
specimen_event,
cataloged_item,
collection
where
locality.locality_id = collecting_event.locality_id AND
collecting_event.collecting_event_id = specimen_event.collecting_event_id AND
specimen_event.collection_object_id=cataloged_item.collection_object_id AND
cataloged_item.collection_id=collection.collection_id and
geog_auth_rec_id=#geog_auth_rec_id#
group by
collection.collection_id,
collection.guid_prefix
order by
collection.guid_prefix
</cfquery>
<cfquery name="sspe" dbtype="query">
select sum(c) sct from specimen
</cfquery>
<div style="border:2px solid blue; background-color:red;">
Altering this record will update:
<ul>
<li>#localities.c# <a href="Locality.cfm?geog_auth_rec_id=#geog_auth_rec_id#&action=findLocality">localities</a></li>
<li>#collecting_events.c# <a href="Locality.cfm?geog_auth_rec_id=#geog_auth_rec_id#&action=findCollEvent">collecting events</a></li>
<li>#sspe.sct# <a href="/SpecimenResults.cfm?geog_auth_rec_id=#geog_auth_rec_id#">specimens</a></li>
<cfloop query="specimen">
<li>
<a href="/SpecimenResults.cfm?geog_auth_rec_id=#geog_auth_rec_id#&collection_id=#specimen.collection_id#">
#specimen.c# #guid_prefix# specimens
</a>
</li>
</cfloop>
</ul>
</div>
</cfoutput>
<cfoutput query="geogDetails">
<br><em>#higher_geog#</em>
<cfform name="getHG" method="post" action="Locality.cfm">
<input name="Action" type="hidden" value="saveGeogEdits">
<input type="hidden" name="geog_auth_rec_id" value="#geog_auth_rec_id#">
<table>
<tr>
<td>
<label for="continent_ocean" class="likeLink" onClick="getDocs('higher_geography','continent_ocean')">
Continent or Ocean
</label>
<input type="text" name="continent_ocean" id="continent_ocean" value="#continent_ocean#" size="60"></td>
<td>
<label for="country" class="likeLink" onClick="getDocs('higher_geography','country')">
Country
</label>
<input type="text" name="country" id="country" size="60" value="#country#">
</td>
</tr>
<tr>
<td>
<label for="state_prov" class="likeLink" onClick="getDocs('higher_geography','state_province')">
State/Province
</label>
<input type="text" name="state_prov" id="state_prov" value="#state_prov#" size="60">
</td>
<td>
<label for="sea" class="likeLink" onClick="getDocs('higher_geography','sea')" >
Sea
</label>
<input type="text" name="sea" id="sea" value="#sea#" size="60">
</td>
</tr>
<tr>
<td>
<label for="county" class="likeLink" onClick="getDocs('higher_geography','county')">
County
</label>
<input type="text" name="county" id="county" value="#county#" size="60">
</td>
<td>
<label for="quad" class="likeLink" onClick="getDocs('higher_geography','map_name')">
Quad
</label>
<input type="text" name="quad" id="quad" value="#quad#" size="60">
</td>
</tr>
<tr>
<td>
<cfif isdefined("feature")>
<cfset thisFeature = feature>
<cfelse>
<cfset thisFeature = "">
</cfif>
<label for="feature" class="likeLink" onClick="getDocs('higher_geography','feature')">
Feature
</label>
<select name="feature" id="feature">
<option value=""></option>
<cfloop query="ctFeature">
<option <cfif thisFeature is ctFeature.feature> selected="selected" </cfif>
value = "#ctFeature.feature#">#ctFeature.feature#</option>
</cfloop>
</select>
</td>
<td>
</td>
</tr>
<tr>
<td>
<label for="island_group" class="likeLink" onClick="getDocs('higher_geography','island_group')">
Island Group
</label>
<select name="island_group" id="island_group" size="1">
<option value=""></option>
<cfloop query="ctIslandGroup">
<option
<cfif geogdetails.island_group is ctislandgroup.island_group> selected="selected" </cfif>value="#ctIslandGroup.island_group#">#ctIslandGroup.island_group#</option>
</cfloop>
</select>
</td>
<td >
<label for="island" >
<span class="likeLink" onClick="getDocs('higher_geography','island')">Island</span>
<span class="likeLink" onClick="asterisckificateisland();">
[ prefix with * ]
</span>
to override duplicate detection
</label>
<input type="text" name="island" id="island" value="#island#" size="60">
</td>
</tr>
<tr>
<td colspan="2">
<label for="source_authority">
Authority (pattern: http://{language}.wikipedia.org/wiki/{article})
</label>
<input type="url" name="source_authority" id="source_authority" class="reqdClr" required value="#source_authority#" pattern="https?://[a-z]{2}.wikipedia.org/wiki/.{1,}" size="80">
</td>
</tr>
<tr>
<td colspan="4">
<label for="geog_remark">Remarks (why is this unique, how is it different from similar values, etc.)</label>
<textarea name="geog_remark" id="geog_remark" class="hugetextarea" rows="60" cols="10">#geog_remark#</textarea>
</td>
</tr>
<cfquery name="geog_search_term" datasource="uam_god">
select * from geog_search_term where geog_auth_rec_id=#geog_auth_rec_id#
</cfquery>
<tr>
<td colspan="4">
<div class="smaller">
<strong>Geog Terms</strong> are "non-standard" terms that might be useful in finding stuff or clarifying an entry.
</div>
</td>
</tr>
<input type="hidden" name="numGeogSrchTerms" id="numGeogSrchTerms" value="1">
<tr id="gst1">
<td colspan="4">
<label for="new_geog_search_term_1">
Add Geog Search Term <span class="likeLink" onclick="addGeoSrchTerm();">[ add a row ]</span>
</label>
<textarea name="new_geog_search_term_1" id="new_geog_search_term_1" class="longtextarea newRec" rows="30" cols="1"></textarea>
</td>
</tr>
<tr>
<td colspan="4">
<label for="">Existing Geog Search Term(s)</label>
</td>
</tr>
<cfloop query="geog_search_term">
<tr>
<td colspan="4">
<textarea name="geog_search_term_#geog_search_term_id#" id="geog_search_term_#geog_search_term_id#" class="longtextarea" rows="30" cols="1">#search_term#</textarea>
<span class="infoLink" onclick="clearTerm('geog_search_term_#geog_search_term_id#');">delete</span>
</td>
</tr>
</cfloop>
<tr>
<td colspan="4" nowrap align="center">
<input type="submit" value="Save Edits" class="savBtn">
<input type="button" value="Delete" class="delBtn"
onClick="document.location='Locality.cfm?Action=deleteGeog&geog_auth_rec_id=#geog_auth_rec_id#';">
<input type="button" value="See Localities" class="lnkBtn"
onClick="document.location='Locality.cfm?Action=findLocality&geog_auth_rec_id=#geog_auth_rec_id#';">
<cfset dloc="Locality.cfm?action=newHG&continent_ocean=#continent_ocean#&country=#country#&state_prov=#state_prov#&county=#county#&quad=#quad#&feature=#feature#&island_group=#island_group#&island=#island#&sea=#sea#">
<input type="button" value="Create Clone" class="insBtn" onclick="document.location='#dloc#';">
</td>
</tr>
</table>
</cfform>
<hr>
<form name="fgeog_search_term" id="fgeog_search_term" method="post" action="Locality.cfm">
</form>
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "updateAllVerificationStatus">
<cfoutput>
<cfquery name="upall" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
update
specimen_event
set
VerificationStatus='#VerificationStatus#'
where
COLLECTING_EVENT_ID='#COLLECTING_EVENT_ID#' and
COLLECTION_OBJECT_ID in (select COLLECTION_OBJECT_ID from cataloged_item) -- keep things on the right side of the VPD
<cfif isdefined("VerificationStatusIs") and len(VerificationStatusIs) gt 0>
and VerificationStatus='#VerificationStatusIs#'
</cfif>
</cfquery>
<cflocation addtoken="false" url="Locality.cfm?action=editCollEvnt&collecting_event_id=#collecting_event_id#">
</cfoutput>
</cfif>
<!---------------------------------------------------------------------------------------------------->
<cfif action is "editCollEvnt">
<cfset title="Edit Collecting Event">
<cfoutput>
<cfquery name="locDet" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
higher_geog,
spec_locality,
locality_name,
collecting_event.collecting_event_id,
locality.locality_id,
verbatim_locality,
BEGAN_DATE,
ENDED_DATE,
VERBATIM_DATE,
COLL_EVENT_REMARKS,
Verbatim_coordinates,
max_error_distance,
max_error_units,
collecting_event_name,
locality.DEC_LAT loclat,
locality.DEC_LONG loclong,
LAT_DEG,
DEC_LAT_MIN,
LAT_MIN,
LAT_SEC,
LAT_DIR,
LONG_DEG,
DEC_LONG_MIN,
LONG_MIN,
LONG_SEC,
LONG_DIR,
locality.DATUM localityDATUM,
collecting_event.DEC_LAT,
collecting_event.DEC_LONG,
collecting_event.DATUM,
UTM_ZONE,
UTM_EW,
UTM_NS,
ORIG_LAT_LONG_UNITS,
caclulated_dlat,
calculated_dlong,
MINIMUM_ELEVATION,
MAXIMUM_ELEVATION,
ORIG_ELEV_UNITS,
MIN_DEPTH,
MAX_DEPTH,
DEPTH_UNITS,
LOCALITY_REMARKS,
georeference_source,
georeference_protocol
from
locality,
geog_auth_rec,
collecting_event
where
locality.geog_auth_rec_id = geog_auth_rec.geog_auth_rec_id and
locality.locality_id=collecting_event.locality_id and
collecting_event.collecting_event_id=<cfqueryparam value = "#collecting_event_id#" CFSQLType = "CF_SQL_INTEGER">
</cfquery>
<cfinvoke component="component.functions" method="getEventContents" returnvariable="contents">
<cfinvokeargument name="collecting_event_id" value="#collecting_event_id#">
</cfinvoke>
#contents#
<br>
<div style="border:5px solid red; background-color:red;">
<br>Red is scary. This form is dangerous. Make sure you know what it's doing before you get all clicky.
<cfquery name="vstat" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
verificationstatus,
guid_prefix,
count(*) c
from
specimen_event,
cataloged_item,
collection
where
specimen_event.collection_object_id=cataloged_item.collection_object_id and
cataloged_item.collection_id=collection.collection_id and
specimen_event.collecting_event_id=#locDet.collecting_event_id#
group by
verificationstatus,
guid_prefix
</cfquery>
<label for="dfs">"Your" specimens in this collecting event:</label>
<table id="dfs" border>
<tr>
<th>Collection</th>
<th>VerificationStatus</th>
<th>NumberSpecimenEvents</th>
</tr>
<cfloop query="vstat">
<tr>
<td>#guid_prefix#</td>
<td>#verificationstatus#</td>
<td>#c#</td>
</tr>
</cfloop>
</table>
<form name="x" method="post" action="Locality.cfm">
<input type="hidden" name="collecting_event_id" value="#locDet.collecting_event_id#">
<input type="hidden" name="action" value="updateAllVerificationStatus">
<span class="likeLink" onClick="getDocs('lat_long','verification_status')">[ verificationstatus documentation ]</span>
<label for="VerificationStatus">
Mass-update specimen-events in this collecting event to.....
</label>
<select name="VerificationStatus" id="verificationstatus" size="1" class="reqdClr">
<option value=""></option>
<cfloop query="ctVerificationStatus">
<option value="#VerificationStatus#">#VerificationStatus#</option>
</cfloop>
</select>
<label for="VerificationStatusIs">
.....where current verificationstatus IS (leave blank to get everything)
</label>
<select name="VerificationStatusIs" id="VerificationStatusIs" size="1" class="reqdClr">
<option value=""></option>
<cfloop query="ctVerificationStatus">
<option value="#VerificationStatus#">#VerificationStatus#</option>
</cfloop>
</select>
where
<br>
<input type="submit" class="lnkBtn" value="Mass-update specimen-events">
</form>
</div>
<cfform name="locality" method="post" action="Locality.cfm">
<table width="100%"><tr><td valign="top">
<h4>Edit this Collecting Event:</h4>
<input type="hidden" name="action" value="saveCollEventEdit">
<input type="hidden" name="collecting_event_id" value="#locDet.collecting_event_id#">
<input type="hidden" name="collection_object_id" value="#collection_object_id#">
<input type="hidden" name="locality_id" id="locality_id" value="#locDet.locality_id#">
<label for="verbatim_locality" class="likeLink" onclick="getDocs('collecting_event','verbatim_locality')">
Verbatim Locality
</label>
<input type="text" name="verbatim_locality" id="verbatim_locality" value='#stripQuotes(locDet.verbatim_locality)#' size="50">
<div id="specific_locality" style="display:none;border:2px solid red;">
<label for="picked_spec_locality">
If you're seeing this, you've picked the below specloc and havne't saved changes. Save to refresh
locality information in the right pane and get rid of this annoying red box.
</label>
<input type="text" name="picked_spec_locality" id="picked_spec_locality" size="75" >
</div>
<label for="verbatim_date" class="likeLink" onclick="getDocs('collecting_event','verbatim_date')">
Verbatim Date
</label>
<input type="text" name="VERBATIM_DATE" id="verbatim_date" value="#locDet.VERBATIM_DATE#" class="reqdClr">
<table>
<tr>
<td>
<label for="began_date" class="likeLink" onclick="getDocs('collecting_event','began_date')">
Began Date/Time
</label>
<input type="text" name="began_date" id="began_date" value="#locDet.began_date#" size="20">
</td>
<td>
<label for="ended_date" class="likeLink" onclick="getDocs('collecting_event','ended_date')">
Ended Date/Time
</label>
<input type="text" name="ended_date" id="ended_date" value="#locDet.ended_date#" size="20">
</td>
</tr>
</table>
<label for="coll_event_remarks">Collecting Event Remark</label>
<input type="text" name="coll_event_remarks" id="coll_event_remarks" value="#stripQuotes(locDet.COLL_EVENT_REMARKS)#" size="50">
<label for="collecting_event_name">Collecting Event Nickname</label>
<input type="text" name="collecting_event_name" id="collecting_event_name" value="#locDet.collecting_event_name#" size="50">
<cfif len(locDet.collecting_event_name) is 0>
<span class="infoLink" onclick="$('##collecting_event_name').val('#CreateUUID()#');">create GUID</span>
</cfif>
<label>Verbatim Coordinates (These are NOT necessarily the same as the mappable coordinate
data given for Locality. Entering verbatim coordinates and picking an appropriate locality are separate tasks.)</label>
<script>
function useLocCoords(lat,lon,datum) {
showLLFormat('decimal degrees');
$("##DEC_LAT").val(lat);
$("##DEC_LONG").val(lon);
$("##datum").val(datum);
}
function showLLFormat(orig_units) {
$("##dd").hide();
$("##dms").hide();
$("##dmm").hide();
$("##utm").hide();
<!----
$("##DEC_LAT").val('');
$("##DEC_LONG").val('');
$("##LAT_DEG").val('');
$("##LAT_MIN").val('');
$("##LAT_SEC").val('');
$("##LAT_DIR").val('');
$("##LONG_DEG").val('');
$("##LONG_MIN").val('');
$("##LONG_SEC").val('');
$("##LONG_DIR").val('');
$("##dmLAT_DEG").val('');
$("##DEC_LAT_MIN").val('');
$("##dmLAT_DIR").val('');
$("##dmLONG_DEG").val('');
$("##DEC_LONG_MIN").val('');
$("##dmLONG_DIR").val('');
$("##UTM_ZONE").val('');
$("##UTM_EW").val('');
$("##UTM_NS").val('');
---->
if (orig_units == 'decimal degrees') {
$("##dd").show();
}
else if (orig_units == 'UTM') {
$("##utm").show();
}
else if (orig_units == 'degrees dec. minutes') {
$("##dmm").show();
}
else if (orig_units == 'deg. min. sec.') {
$("##dms").show();
}
$("##orig_lat_long_units").val(orig_units);
}
</script>
<div style="border:2px solid black">
<label for="orig_lat_long_units">Coordinate Units</label>
<select name="orig_lat_long_units" id="orig_lat_long_units" size="1" class="reqdClr" onchange="showLLFormat(this.value);">
<option value="">none</option>
<cfloop query="ctlat_long_units">
<option
<cfif ctlat_long_units.orig_lat_long_units is locDet.orig_lat_long_units> selected="selected" </cfif>
value="#ctlat_long_units.orig_lat_long_units#">#ctlat_long_units.orig_lat_long_units#</option>
</cfloop>
</select>
<label for="datum">Datum</label>
<select name="datum" id="datum" size="1" class="reqdClr">
<option value="">none</option>
<cfloop query="ctdatum">
<option
<cfif ctdatum.datum is locDet.datum> selected="selected" </cfif>
value="#ctdatum.datum#">#ctdatum.datum#</option>
</cfloop>
</select>
<table id="dd" style="display:none;">
<tr>
<td>
<label for="DEC_LAT">Decimal Latitude</label>
<input type="text" name="DEC_LAT" id="DEC_LAT" value="#locDet.DEC_LAT#" size="10">
</td>
<td>
<label for="DEC_LONG">Decimal Longitude</label>
<input type="text" name="DEC_LONG" id="DEC_LONG" value="#locDet.DEC_LONG#" size="10">
</td>
</tr>
</table>
<table id="dms" style="display:none;">
<tr>
<td>
<label for="LAT_DEG">Degrees Latitude</label>
<input type="text" name="LAT_DEG" id="LAT_DEG" value="#locDet.LAT_DEG#" size="10">
</td>
<td>
<label for="LAT_MIN">Minutes Latitude</label>
<input type="text" name="LAT_MIN" id="LAT_MIN" value="#locDet.LAT_MIN#" size="10">
</td>
<td>
<label for="LAT_SEC">Seconds Latitude</label>
<input type="text" name="LAT_SEC" id="LAT_SEC" value="#locDet.LAT_SEC#" size="10">
</td>
<td>
<label for="LAT_DIR">Latitude Direction</label>
<select name="LAT_DIR" id="LAT_DIR">
<option></option>
<option <cfif locDet.LAT_DIR is "N">selected="selected" </cfif> value="N">N</option>
<option <cfif locDet.LAT_DIR is "S">selected="selected" </cfif> value="S">S</option>
</select>
</td>
<td>
<label for="LONG_DEG">Degrees Longitude</label>
<input type="text" name="LONG_DEG" id="LONG_DEG" value="#locDet.LONG_DEG#" size="10">
</td>
<td>
<label for="LONG_MIN">Minutes Longitude</label>
<input type="text" name="LONG_MIN" id="LONG_MIN" value="#locDet.LONG_MIN#" size="10">
</td>
<td>
<label for="LONG_SEC">Seconds Longitude</label>
<input type="text" name="LONG_SEC" id="LONG_SEC" value="#locDet.LONG_SEC#" size="10">
</td>
<td>
<label for="LONG_DIR">Longitude Direction</label>
<select name="LONG_DIR" id="LONG_DIR">
<option></option>
<option <cfif locDet.LONG_DIR is "W">selected="selected" </cfif> value="W">W</option>
<option <cfif locDet.LONG_DIR is "E">selected="selected" </cfif> value="E">E</option>
</select>
</td>
</tr>
</table>
<table id="dmm" style="display:none;">
<tr>
<td>
<label for="dmLAT_DEG">Degrees Latitude</label>
<input type="text" name="dmLAT_DEG" id="dmLAT_DEG" value="#locDet.LAT_DEG#" size="10">
</td>
<td>
<label for="DEC_LAT_MIN">Decimal Latitude Minutes</label>
<input type="text" name="DEC_LAT_MIN" id="DEC_LAT_MIN" value="#locDet.DEC_LAT_MIN#" size="10">
</td>
<td>
<label for="dmLAT_DIR">Latitude Direction</label>
<select name="dmLAT_DIR" id="dmLAT_DIR">
<option></option>
<option <cfif locDet.LAT_DIR is "N">selected="selected" </cfif> value="N">N</option>
<option <cfif locDet.LAT_DIR is "S">selected="selected" </cfif> value="S">S</option>
</select>
</td>
<td>
<label for="dmLONG_DEG">Degrees Longitude</label>
<input type="text" name="dmLONG_DEG" id="dmLONG_DEG" value="#locDet.LONG_DEG#" size="10">
</td>
<td>
<label for="DEC_LONG_MIN">Decimal Longitude Minutes</label>
<input type="text" name="DEC_LONG_MIN" id="DEC_LONG_MIN" value="#locDet.DEC_LONG_MIN#" size="10">
</td>
<td>
<label for="dmLONG_DIR">Degrees Longitude</label>
<select name="dmLONG_DIR" id="dmLONG_DIR">
<option></option>
<option <cfif locDet.LONG_DIR is "W">selected="selected" </cfif> value="W">W</option>
<option <cfif locDet.LONG_DIR is "E">selected="selected" </cfif> value="E">E</option>
</select>
</td>
</tr>
</table>
<table id="utm" style="display:none;">
<tr>
<td>
<label for="UTM_ZONE">UTM Zone</label>
<input type="text" name="UTM_ZONE" id="UTM_ZONE" value="#locDet.UTM_ZONE#" size="10">
</td>
<td>
<label for="UTM_EW">ETM East or West</label>
<input type="text" name="UTM_EW" id="UTM_EW" value="#locDet.UTM_EW#" size="10">
</td>
<td>
<label for="UTM_NS">UTM North or South</label>
<input type="text" name="UTM_NS" id="UTM_NS" value="#locDet.UTM_NS#" size="10">
</td>
</tr>
</table>
<cfif len(locDet.loclat) gt 0>
<div style="border:1px solid black;margin:.5em;padding:.5em">
Locality coordinates are format <strong>decimal degrees</strong>, <strong>#locDet.loclat#</strong>/<strong>#locDet.loclong#</strong> datum <strong>#locDet.localityDATUM#</strong>
<input type="button" onclick="useLocCoords('#locDet.loclat#','#locDet.loclong#','#locDet.localityDATUM#');"
style="insBtn" value="Use Locality coordinates for this event"></button>
</div>
</cfif>
</div>
<script>
showLLFormat('#locDet.orig_lat_long_units#');
</script>
<br>
<input type="button" value="Save" class="savBtn" onClick="locality.action.value='saveCollEventEdit';locality.submit();">
<input type="button" value="Quit" class="qutBtn" onClick="document.location='Locality.cfm';">
<input type="button" value="Delete" class="delBtn"
onClick="document.location='Locality.cfm?Action=deleteCollEvent&collecting_event_id=#locDet.collecting_event_id#';">
<input type="button" value="Clone Event and Locality (eg, to add 'unaccepted' coordinates)" class="insBtn"
onClick="locality.action.value='cloneEventAndLocality';locality.submit();">
<input type="button" value="Clone Event (new event under this locality)" class="insBtn"
onClick="locality.action.value='cloneEventWithoutLocality';locality.submit();">
<!---
<cfset dLoc="Locality.cfm?action=newCollEvent&locality_id=#locDet.locality_id#&verbatim_locality=#locDet.verbatim_locality#&began_date=#locDet.began_date#&ended_date=#locDet.began_date#&verbatim_date=#locDet.verbatim_date#&coll_event_remarks=#locDet.coll_event_remarks#&collecting_source=#locDet.collecting_source#&collecting_method=#locDet.collecting_method#&habitat_desc=#locDet.habitat_desc#">
<input type="button" value="Create Clone" class="insBtn" onClick="document.location='#dLoc#';">
---->
</td>
<td valign="top"><!---------- right side ------------>
<h4>
Locality
<a style="font-size:small;" href="/editLocality.cfm?locality_id=#locDet.locality_id#" target="_top">[ Edit Locality ]</a>