-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditBiolIndiv.cfm
643 lines (630 loc) · 25.2 KB
/
editBiolIndiv.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
<cfinclude template="/includes/alwaysInclude.cfm">
<script language="javascript" type="text/javascript">
jQuery(document).ready(function() {
jQuery("input[id^='determined_date_']").each(function(){
$("#" + this.id).datepicker();
});
$("#determined_date").datepicker();
$("#mammgrid_determined_date").datepicker();
$("input[id^='attribute_id_']").each(function(){
populateAttribute($("#" + this.id).val());
});
});
function deleteAttribute(id){
var d='<input type="hidden" id="deleted_attribute_type_' + id + '" name="deleted_attribute_type_' + id + '">';
$("#atttype_" + id).append(d);
$("#deleted_attribute_type_" + id).val($("#attribute_type_" + id).val());
$("#attribute_type_" + id).val('pending delete');
var d='<input type="button" id="rec_' + id + '" value="undelete" class="savBtn" onclick="undeleteAttribute(' + id + ');">';
$("#attdel_" + id).append(d);
$("#del_" + id).remove();
$("#attribute_value_" + id).toggle();
$("#attribute_units_" + id).toggle();
$("#attribute_remark_" + id).toggle();
$("#determined_date_" + id).toggle();
$("#determination_method_" + id).toggle();
$("#agent_name_" + id).toggle();
}
function undeleteAttribute(id){
$("#attribute_type_" + id).val($("#deleted_attribute_type_" + id).val());
$("#deleted_attribute_type_" + id).remove();
var d='<input type="button" id="del_' + id + '" value="Delete" class="delBtn" onclick="deleteAttribute(\'' + id + '\');">';
$("#attdel_" + id).append(d);
$("#rec_" + id).remove();
$("#attribute_value_" + id).toggle();
$("#attribute_units_" + id).toggle();
$("#attribute_remark_" + id).toggle();
$("#determined_date_" + id).toggle();
$("#determination_method_" + id).toggle();
$("#agent_name_" + id).toggle();
}
function populateAttribute(aid) {
if ($("#attribute_type_" + aid).val()==''){
$("#attribute_value_" + aid).remove();
$("#attribute_units_" + aid).remove();
$("#determined_date_" + aid).removeClass('reqdClr').prop('required',false);
$("#agent_name_" + aid).removeClass('reqdClr').prop('required',false);
return false;
}
jQuery.getJSON("/component/DataEntry.cfc",
{
method : "getAttCodeTbl",
attribute : $("#attribute_type_" + aid).val(),
guid_prefix : $("#guid_prefix").val(),
element : aid,
returnformat : "json",
queryformat : 'column'
},
success_populateAttribute
);
}
function success_populateAttribute (r) {
var result=r.DATA;
var resType=result.V[0];
var aid=result.V[1];
var x;
aid='_' + aid;
$("#attribute_value" + aid).remove();
$("#attribute_units" + aid).remove();
$("#determined_date" + aid).addClass('reqdClr').prop('required',true);;
$("#agent_name" + aid).addClass('reqdClr').prop('required',true);;
if (resType == 'value') {
var d = '<select class="reqdClr" required name="attribute_value' + aid + '" id="attribute_value' + aid + '">';
d+='<option value=""></option>';
for (i=2;i<result.V.length;i++) {
x=result.V[i];
if(x=='_yes_'){
x='yes';
}
if(x=='_no_'){
x='no';
}
d+='<option value="' + x + '">' + x + '</option>';
}
d+='</select>';
$("#_attribute_value" + aid).append(d);
$("#attribute_value" + aid).val($("#val" + aid).val());
} else if (resType == 'units') {
var d = '<select class="reqdClr" required name="attribute_units' + aid + '" id="attribute_units' + aid + '">';
d+='<option value=""></option>';
for (i=2;i<result.V.length;i++) {
d+='<option value="' + result.V[i] + '">' + result.V[i] + '</option>';
}
d+='</select>';
$("#_attribute_units" + aid).append(d);
$("#attribute_units" + aid).val($("#unit" + aid).val());
var t='<input type="text" class="reqdClr" required name="attribute_value' + aid + '" id="attribute_value' + aid + '">';
$("#_attribute_value" + aid).append(t);
$("#attribute_value" + aid).val($("#val" + aid).val());
} else {
var t='<textarea class="smalltextarea reqdClr" required rows="1" cols="15" name="attribute_value' + aid + '" id="attribute_value' + aid + '"></textarea?';
$("#_attribute_value" + aid).append(t);
$("#attribute_value" + aid).val($("#val" + aid).val());
}
}
function useAgent1(){
var theName=$("input[id^='agent_name_']").first().val();
var theID=$("input[id^='determined_by_agent_id_']").first().val();
var theDate=$("input[id^='determined_date_']").first().val();
$("#determined_by_agent_id_new").val(theID);
$("#agent_name_new").val(theName).removeClass('badPick').addClass('goodPick');
$("#determined_date_new").val(theDate);
}
</script>
<cfif action is "nothing">
<strong>Edit Individual Attributes</strong>
<span class="infoLInk" onClick="windowOpener('/info/attributeHelpPick.cfm','','width=600,height=600, resizable,scrollbars');">Help</span>
<cfoutput>
<cfquery name="raw" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
SELECT
COLL_OBJECT_REMARKS,
associated_species,
cataloged_item_type,
flags,
cat_num,
collection.collection_cde,
collection.guid_prefix,
cataloged_item.collection_object_id collection_object_id,
ATTRIBUTE_ID,
agent_name,
determined_by_agent_id,
ATTRIBUTE_TYPE,
ATTRIBUTE_VALUE,
attribute_units,
ATTRIBUTE_REMARK,
DETERMINED_DATE,
DETERMINATION_METHOD
FROM
cataloged_item,
collection,
attributes,
preferred_agent_name,
coll_object,
coll_object_remark
WHERE
cataloged_item.collection_id = collection.collection_id AND
cataloged_item.collection_object_id = attributes.collection_object_id (+) AND
attributes.determined_by_agent_id = preferred_agent_name.agent_id (+) AND
cataloged_item.collection_object_id = coll_object.collection_object_id AND
cataloged_item.collection_object_id = coll_object_remark.collection_object_id (+) AND
cataloged_item.collection_object_id = #collection_object_id#
</cfquery>
<cfquery name="ctflags" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
SELECT flags from ctflags order by flags
</cfquery>
<cfquery name="ctcataloged_item_type" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
SELECT cataloged_item_type from ctcataloged_item_type order by cataloged_item_type
</cfquery>
<cfquery name="ctdisp" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select coll_obj_disposition from ctcoll_obj_disp order by coll_obj_disposition
</cfquery>
<cfquery name="indiv" dbtype="query">
select
CAT_NUM,
cataloged_item_type,
collection_cde,
guid_prefix,
COLL_OBJECT_REMARKS,
associated_species,
flags
FROM
raw
group by
CAT_NUM,
cataloged_item_type,
collection_cde,
guid_prefix,
COLL_OBJECT_REMARKS,
associated_species,
flags
</cfquery>
<cfquery name="ctattribute_type" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
SELECT attribute_type FROM ctattribute_type where collection_cde='#indiv.collection_cde#' order by attribute_type
</cfquery>
<cfquery name="atts" dbtype="query">
select
collection_object_id,
ATTRIBUTE_ID,
agent_name,
determined_by_agent_id,
ATTRIBUTE_TYPE,
ATTRIBUTE_VALUE,
attribute_units,
ATTRIBUTE_REMARK,
DETERMINED_DATE,
DETERMINATION_METHOD
from
raw
where
ATTRIBUTE_TYPE is not null
group by
collection_object_id,
ATTRIBUTE_ID,
agent_name,
determined_by_agent_id,
ATTRIBUTE_TYPE,
ATTRIBUTE_VALUE,
attribute_units,
ATTRIBUTE_REMARK,
DETERMINED_DATE,
DETERMINATION_METHOD
</cfquery>
<form name="details" method="post" action="editBiolIndiv.cfm">
<input type="hidden" value="save" name="action">
<input type="hidden" value="#collection_object_id#" name="collection_object_id">
<input type="hidden" value="#indiv.collection_cde#" name="collection_cde" id="collection_cde">
<input type="hidden" value="#indiv.guid_prefix#" name="guid_prefix" id="guid_prefix">
<table width="100%">
<tr>
<td>
<label for="flags">Missing</label>
<select name="flags" id="flags" size="1">
<option value=""></option>
<cfloop query="ctflags">
<option <cfif indiv.flags is ctflags.flags> selected="selected" </cfif>value="#flags#">#flags#</option>
</cfloop>
</select>
</td>
<td>
<label for="cataloged_item_type">CatItemType</label>
<select name="cataloged_item_type" id="cataloged_item_type" size="1" class="reqdClr">
<cfloop query="ctcataloged_item_type">
<option <cfif indiv.cataloged_item_type is ctcataloged_item_type.cataloged_item_type> selected="selected" </cfif>value="#cataloged_item_type#">#cataloged_item_type#</option>
</cfloop>
</select>
</td>
</tr>
</table>
<label for="coll_object_remarks">Specimen Remarks</label>
<textarea name="coll_object_remarks" id="coll_object_remarks" cols="80" rows="2">#indiv.coll_object_remarks#</textarea>
<label for="associated_species">Associated Species</label>
<textarea name="associated_species" id="associated_species" cols="80" rows="2">#indiv.associated_species#</textarea>
<cfset i=1>
<table border cellpadding="2">
<tr>
<td>Attribute</td>
<td>Value</td>
<td>Units</td>
<td>Remarks</td>
<td>Det. Date</td>
<td>Det. Meth</td>
<td>Determiner</td>
<td> </td>
</tr>
<input type="hidden" name="number_of_attributes" id="number_of_attributes" value="#atts.recordcount#">
<cfloop query="atts">
<input type="hidden" name="attribute_id_#i#" id="attribute_id_#i#" value="#attribute_id#">
<tr #iif(i MOD 2,DE("class='evenRow'"),DE("class='oddRow'"))#>
<td id="atttype_#attribute_id#">
<input type="text" name="attribute_type_#attribute_id#" id="attribute_type_#attribute_id#" value="#attribute_type#" readonly="yes" class="readClr">
</td>
<td id="_attribute_value_#attribute_id#">
<input type="hidden" name="val_#attribute_id#" id="val_#attribute_id#" value="#stripQuotes(attribute_value)#">
</td>
<td id="_attribute_units_#attribute_id#">
<input type="hidden" name="unit_#attribute_id#" id="unit_#attribute_id#" value="#attribute_units#">
</td>
<td id="_remarks_#attribute_id#">
<input type="text" name="attribute_remark_#attribute_id#" id="attribute_remark_#attribute_id#" value="#stripQuotes(attribute_remark)#">
</td>
<td id="_determined_date_#attribute_id#">
<input type="text" name="determined_date_#attribute_id#" id="determined_date_#attribute_id#"
value="#determined_date#" class="reqdClr" size="12">
</td>
<td id="_determination_method_#attribute_id#">
<input type="text" name="determination_method_#attribute_id#" id="determination_method_#attribute_id#" value="#stripQuotes(determination_method)#">
</td>
<td id="_agent_name_#attribute_id#">
<input type="hidden" name="determined_by_agent_id_#attribute_id#" id="determined_by_agent_id_#attribute_id#"
value="#determined_by_agent_id#">
<input type="text" name="agent_name_#attribute_id#" id="agent_name_#attribute_id#" class="reqdClr"
value="#stripQuotes(agent_name)#" size="50"
onchange="pickAgentModal('determined_by_agent_id_#attribute_id#',this.id,this.value); return false;"
onKeyPress="return noenter(event);">
</td>
<td id="attdel_#attribute_id#">
<input type="button" id="del_#attribute_id#" value="Delete" class="delBtn" onclick="deleteAttribute('#attribute_id#');">
</td>
</tr>
<cfset i=i+1>
</cfloop>
<tr class="newRec">
<td>
<select name="attribute_type_new" id="attribute_type_new" size="1" onChange="populateAttribute('new');">
<option value="">Create New Attribute</option>
<cfloop query="ctattribute_type">
<option value="#ctattribute_type.attribute_type#">#ctattribute_type.attribute_type#</option>
</cfloop>
</select>
</td>
<td id="_attribute_value_new">
<td id="_attribute_units_new">
<td id="arm">
<input type="text" name="attribute_remark_new" id="attribute_remark_new">
</td>
<td id="ddn">
<input type="text" name="determined_date_new" id="determined_date_new" class="" size="12">
</td>
<td id="determination_method_new">
<input type="text" name="determination_method_new" id="determination_method_new">
</td>
<td id="ann">
<input type="hidden" name="determined_by_agent_id_new" id="determined_by_agent_id_new">
<input type="text" name="agent_name_new" id="agent_name_new" size="50"
onchange="pickAgentModal('determined_by_agent_id_new',this.id,this.value); return false;"
onKeyPress="return noenter(event);" placeholder="pick an agent" class="reqdClr">
<!----
<input type="text" name="agent_name_new" id="agent_name_new" class=""
onchange="getAgent('determined_by_agent_id_new',this.id,'details',this.value); return false;"
onKeyPress="return noenter(event);">
---->
</td>
<td>
<span onclick="useAgent1()" class="infolink">[use Agent1/Date1]</span>
</td>
</tr>
</table>
<cfif indiv.collection_cde is "Mamm">
<cfquery name="ctlength_units" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select length_units from ctlength_units order by length_units
</cfquery>
<cfquery name="ctweight_units" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select weight_units from ctweight_units order by weight_units
</cfquery>
<label for="mammatttab">Existing values will NOT show up in this grid; add mammal attributes only.</label>
<table id="mammatttab" class="newRec">
<tr>
<td>
<label for="total_length">Total</label>
<input type="text" name="total_length" size="4">
<select name="total_length_units" size="1">
<cfloop query="ctlength_units">
<option <cfif length_units is "mm"> selected="selected" </cfif>
value="#ctlength_units.length_units#">#ctlength_units.length_units#</option>
</cfloop>
</select>
</td>
<td>
<label for="tail_length">Tail</label>
<input type="text" name="tail_length" size="4">
<select name="tail_length_units" size="1">
<cfloop query="ctlength_units">
<option <cfif length_units is "mm"> selected="selected" </cfif>
value="#ctlength_units.length_units#">#ctlength_units.length_units#</option>
</cfloop>
</select>
</td>
<td>
<label for="hind_foot_with_claw">HF(c)</label>
<input type="text" name="hind_foot_with_claw" size="4">
<select name="hind_foot_with_claw_units" size="1">
<cfloop query="ctlength_units">
<option <cfif length_units is "mm"> selected="selected" </cfif>
value="#ctlength_units.length_units#">#ctlength_units.length_units#</option>
</cfloop>
</select>
</td>
<td>
<label for="ear_from_notch">EFN</label>
<input type="text" name="ear_from_notch" size="4">
<select name="ear_from_notch_units" size="1">
<cfloop query="ctlength_units">
<option <cfif length_units is "mm"> selected="selected" </cfif>
value="#ctlength_units.length_units#">#ctlength_units.length_units#</option>
</cfloop>
</select>
</td>
<td>
<label for="weight">WT</label>
<input type="text" name="weight" size="4">
<select name="weight_units" size="1">
<cfloop query="ctweight_units">
<option <cfif weight_units is "g"> selected="selected" </cfif>
value="#ctweight_units.weight_units#">#ctweight_units.weight_units#</option>
</cfloop>
</select>
</td>
<td>
<label for="determined_date">Date</label>
<input type="text" name="determined_date" id="mammgrid_determined_date" class="reqdClr" size="10">
</td>
<td>
<label for="mammgrid_detagentid">Determiner</label>
<input type="hidden" name="mammgrid_detagentid">
<input type="text" name="mammgrid_determiner" class="reqdClr"
onchange="getAgent('mammgrid_detagentid',this.name,'details',this.value); return false;">
</td>
</tr>
</table>
</cfif>
<br>
<div align="center">
<input type="submit" value="save all" class="savBtn">
</div>
</form>
</cfoutput>
</cfif>
<!------------------------------------------------------------------------------>
<cfif action is "save">
<cfoutput>
<cftransaction>
<cfloop from="1" to="#number_Of_Attributes#" index="n">
<cfset thisAttributeId = evaluate("attribute_id_" & n)>
<cfset thisAttributeType = evaluate("attribute_type_" & thisAttributeId)>
<cftry>
<cfset thisAttributeUnits = evaluate("attribute_units_" & thisAttributeId)>
<cfcatch>
<cfset thisAttributeUnits = ''>
</cfcatch>
</cftry>
<cftry>
<cfset thisAttributeValue = evaluate("attribute_value_" & thisAttributeId)>
<cfcatch>
<cfset thisAttributeValue = ''>
</cfcatch>
</cftry>
<cfset thisAttributeRemark = evaluate("attribute_remark_" & thisAttributeId)>
<cfset thisDeterminedDate = evaluate("determined_date_" & thisAttributeId)>
<cfset thisDeterminationMethod = evaluate("determination_method_" & thisAttributeId)>
<cfset thisDeterminedByAgentId = evaluate("determined_by_agent_id_" & thisAttributeId)>
<cfif thisAttributeType is "pending delete">
<cfquery name="killAtt" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
delete from attributes where attribute_id=#thisAttributeId#
</cfquery>
<cfelse>
<cfquery name="upAtt" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
UPDATE attributes SET
attribute_type='#thisAttributeType#',
DETERMINED_BY_AGENT_ID = #thisDeterminedByAgentId#,
ATTRIBUTE_VALUE='#thisAttributeValue#',
ATTRIBUTE_UNITS='#thisAttributeUnits#',
ATTRIBUTE_REMARK='#thisAttributeRemark#',
DETERMINED_DATE='#thisDeterminedDate#',
DETERMINATION_METHOD='#thisDeterminationMethod#'
WHERE
attribute_id=#thisAttributeId#
</cfquery>
</cfif>
</cfloop>
<!---- mammal grid ----->
<cfif isdefined("total_length")>
<cfif len(total_length) gt 0>
<cfquery name="total_length" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO attributes (
ATTRIBUTE_ID
,COLLECTION_OBJECT_ID
,DETERMINED_BY_AGENT_ID
,ATTRIBUTE_TYPE
,ATTRIBUTE_VALUE
,ATTRIBUTE_UNITS
,DETERMINED_DATE
)
VALUES (
sq_attribute_id.nextval
,#collection_object_id#
,#mammgrid_detagentid#
,'total length'
,'#total_length#'
,'#total_length_units#'
,'#DETERMINED_DATE#')
</cfquery>
</cfif>
<cfif len(tail_length) gt 0>
<cfquery name="tail_length" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO attributes (
ATTRIBUTE_ID
,COLLECTION_OBJECT_ID
,DETERMINED_BY_AGENT_ID
,ATTRIBUTE_TYPE
,ATTRIBUTE_VALUE
,ATTRIBUTE_UNITS
,DETERMINED_DATE
)
VALUES (
sq_attribute_id.nextval
,#collection_object_id#
,#mammgrid_detagentid#
,'tail length'
,'#tail_length#'
,'#tail_length_units#'
,'#DETERMINED_DATE#')
</cfquery>
</cfif>
<cfif len(hind_foot_with_claw) gt 0>
<cfquery name="hind_foot_with_claw" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO attributes (
ATTRIBUTE_ID
,COLLECTION_OBJECT_ID
,DETERMINED_BY_AGENT_ID
,ATTRIBUTE_TYPE
,ATTRIBUTE_VALUE
,ATTRIBUTE_UNITS
,DETERMINED_DATE
)
VALUES (
sq_attribute_id.nextval,
#collection_object_id#
,#mammgrid_detagentid#
,'hind foot with claw'
,'#hind_foot_with_claw#'
,'#hind_foot_with_claw_units#'
,'#DETERMINED_DATE#')
</cfquery>
</cfif>
<cfif len(ear_from_notch) gt 0>
<cfquery name="ear_from_notch" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO attributes (
ATTRIBUTE_ID
,COLLECTION_OBJECT_ID
,DETERMINED_BY_AGENT_ID
,ATTRIBUTE_TYPE
,ATTRIBUTE_VALUE
,ATTRIBUTE_UNITS
,DETERMINED_DATE
)
VALUES (
sq_attribute_id.nextval,
#collection_object_id#
,#mammgrid_detagentid#
,'ear from notch'
,'#ear_from_notch#'
,'#ear_from_notch_units#'
,'#DETERMINED_DATE#')
</cfquery>
</cfif>
<cfif len(weight) gt 0>
<cfquery name="weight" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO attributes (
ATTRIBUTE_ID
,COLLECTION_OBJECT_ID
,DETERMINED_BY_AGENT_ID
,ATTRIBUTE_TYPE
,ATTRIBUTE_VALUE
,ATTRIBUTE_UNITS
,DETERMINED_DATE
)
VALUES (
sq_attribute_id.nextval
,#collection_object_id#
,#mammgrid_detagentid#
,'weight'
,'#weight#'
,'#weight_units#'
,'#DETERMINED_DATE#')
</cfquery>
</cfif>
</cfif>
<!--- new attribute --->
<cfif len(attribute_type_new) gt 0>
<cfif not isdefined("attribute_units_new")>
<cfset attribute_units_new=''>
</cfif>
<cfquery name="newAtt" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO attributes (
ATTRIBUTE_ID
,COLLECTION_OBJECT_ID
,DETERMINED_BY_AGENT_ID
,ATTRIBUTE_TYPE
,ATTRIBUTE_VALUE
,ATTRIBUTE_UNITS
,ATTRIBUTE_REMARK
,DETERMINED_DATE
,DETERMINATION_METHOD
) VALUES (
sq_attribute_id.nextval
,#collection_object_id#
,#determined_by_agent_id_new#
,'#attribute_type_new#'
,'#attribute_value_new#'
,'#attribute_units_new#'
,'#ATTRIBUTE_REMARK_new#'
,'#DETERMINED_DATE_new#'
,'#DETERMINATION_METHOD_new#'
)
</cfquery>
</cfif>
<cfquery name="upCollObj" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
UPDATE coll_object SET
last_edited_person_id = #session.myAgentId#
,last_edit_date = sysdate
,flags='#flags#'
WHERE collection_object_id = #collection_object_id#
</cfquery>
<cfquery name="cataloged_item_type" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
update cataloged_item set cataloged_item_type='#cataloged_item_type#' where
collection_object_id = #collection_object_id#
</cfquery>
<cfquery name="isCORem" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select collection_object_id from coll_object_remark where
collection_object_id = #collection_object_id#
</cfquery>
<cfif len(isCORem.collection_object_id) gt 0>
<cfquery name="upCoRem" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
UPDATE coll_object_remark SET
collection_object_id = #collection_object_id#
,coll_object_remarks = '#coll_object_remarks#'
,associated_species = '#associated_species#'
WHERE
collection_object_id = #collection_object_id#
</cfquery>
<cfelse>
<cfif len(coll_object_remarks) gt 0 or len(associated_species) gt 0>
<cfquery name="newBIRem" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
INSERT INTO coll_object_remark (
collection_object_id
,coll_object_remarks
,associated_species
) VALUES (
#collection_object_id#
,'#escapeQuotes(coll_object_remarks)#'
,'#escapeQuotes(associated_species)#'
)
</cfquery>
</cfif>
</cfif>
</cftransaction>
<cflocation url="editBiolIndiv.cfm?collection_object_id=#collection_object_id#" addtoken="false">
</cfoutput>
</cfif>
<!------------------------------------------------------------------------------>
<cf_customizeIFrame>