This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditLoanRequest.html
141 lines (110 loc) · 4.11 KB
/
EditLoanRequest.html
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>ILLiad - Edit Book Request</title>
<#INCLUDE filename="include_head.html">
</head>
<body>
<#INCLUDE filename="include_header.html">
<#INCLUDE filename="include_menu.html">
<div class="container">
<main id="content" aria-label="Content" class="display-none">
<form id="EditLoanRequest" action="illiad.dll" method="post" name="EditLoanRequest">
<input type="hidden" name="ILLiadForm" value="EditLoanRequest">
<input type="hidden" name="Username" value="<#PARAM name='Username'>">
<input type="hidden" name="SessionID" value="<#PARAM name='SessionID'>">
<input type="hidden" name="TransactionNumber" value="<#PARAM name='TransactionNumber'>">
<input type="hidden" name="ItemInfo1" id="ItemInfo1" value="<#PARAM name='ItemInfo1'>">
<fieldset>
<h2 class="page-header" id="pageHeader">Edit Loan Request (Including Multimedia)</h2>
<#INCLUDE filename='include_edit_loan_request_fields.html'>
<#INCLUDE filename="include_request_cited.html">
<#INCLUDE filename="include_request_buttons.html">
</fieldset>
</form>
</main>
<#INCLUDE filename="include_footer.html">
</div>
<#INCLUDE filename='include_js_helpers.html'> <!--- includes helper javascript functions for interacting with the page's html -->
<script>
function showDocDeliveryFormElements(){
unHideFormGroup("facOrGrad");
unHideFormGroup("itemInfo2");
unHideFormGroup("ItemInfo3");
unHideFormGroup("ItemInfo4");
unHideFormGroup("itemInfo5");
}
function hideNonDocDeliveryFormElements(){
hideFormGroup('ESPNumber');
hideFormGroup('AcceptNonEnglish');
hideElement('ISSNNote'); // TODO: not sure where this is used
}
$(document).ready(function(){
const docDeliveryStatus = $('input#ItemInfo1').attr('value');
const isSerialLoanRequest = $('#itemInfo2').val() == 'Yes';
if ((docDeliveryStatus == 'DocDelivery') || (docDeliveryStatus == 'DocDeliveryPublic')){
isDocDelivery = true;
if (isSerialLoanRequest){
requiredFields = requiredFieldsLoanReqDocDelivery.serialRequest;
} else {
requiredFields = requiredFieldsLoanReqDocDelivery.noSerialRequest;
}
}
else{
isDocDelivery = false;
requiredFields = requiredFieldsLoanReq;
}
// add 'required' attribute to all required fields
requiredFields.forEach(field => {
makeRequired(field);
});
if (isDocDelivery == true){
hideElement('#requestCited');
//Hide buttons that no longer work
//$('input[name="ResetButton"]').css('display', 'none');
hideElement('input[value^="Cancel"]');
$('#pageHeader').html("Edit Document Delivery - Loan (UA Libraries Collection)");
showDocDeliveryFormElements();
hideNonDocDeliveryFormElements();
//The value of fac or grad is not stored, but can be inferred in this case from ItemInfo4 (pickup location) having the value of "Mail to address"
if ($("#ItemInfo4").val() == 'Mail to address'){
$("#facOrGrad").val('Distance student');
}
$('#facOrGrad').change(function(){
$.proxy(facOrGradChange, $('#facOrGrad'))();
});
//Campus mailbox
$('#ItemInfo3').change(function(){
$.proxy(campusMailboxChange, $('#ItemInfo3'))();
});
//Pickup library
$('#ItemInfo4').change(function(){
$.proxy(pickupLibraryChange, $('#ItemInfo4'))(); ;
});
//Annex request
$('#itemInfo5').change(function(){
$.proxy(annexRequestChange, $('#itemInfo5'))();
});
//Serial loan request
$('#itemInfo2').change(function(){
$.proxy(serialLoanChange, $('#itemInfo2'))();
});
//Ensure edit document delivery - loan updates with correct fields
$('#itemInfo2').change();
$('#ItemInfo3').change();
$('#itemInfo5').change();
}
$('#EditLoanRequest').submit(function(event){
//Validate form, etc.
var returnValue = $.proxy(docDeliverySubmit, $('#LoanRequestForm'))();
//docDeliverySubmit returns false if the form is invalid
if (returnValue == false){
console.log("RETURN VALUE IS FALSE!");
return false;
}
});
unHideElement("#content");
});
</script>
</body>
</html>