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
/
LoanRequest.html
157 lines (116 loc) · 5.15 KB
/
LoanRequest.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>ILLiad - 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 action="illiad.dll" method="post" name="LoanRequest" id="LoanRequestForm">
<input type="hidden" name="ILLiadForm" value="LoanRequest">
<input type="hidden" name="Username" value="<#PARAM name='Username'>">
<input type="hidden" name="ItemInfo1" value="Book">
<input type="hidden" name="SessionID" value="<#PARAM name='SessionID'>">
<input type="hidden" name="DocumentType" value="Book">
<fieldset>
<h2 class="page-header" id="pageHeader">Physical Item (Request Physical Items from Non-UA Libraries)</h2>
<#STATUS>
<#INCLUDE filename='include_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>
</body>
<#INCLUDE filename='include_js_helpers.html'> <!--- includes helper javascript functions for interacting with the page's html -->
<script>
// show form elements form doc delivery form
function showDocDeliveryFormElements(){
unHideFormGroup("facOrGrad");
unHideFormGroup("ItemInfo4");
unHideFormGroup("itemInfo2");
unHideFormGroup("itemInfo5");
unHideFormGroup("itemInfo2");
}
// hide non-DocDelivery form elements
function hideNonDocDeliveryFormElements(){
hideFormGroup("ESPNumber");
hideFormGroup("AcceptNonEnglish");
hideElement("#ISSNNote");
}
$(document).ready(function () {
let parameters = decodeURIComponent(document.location.search);
isDocDelivery = parameters.indexOf('docdelivery=true') !== -1;
let isSerialLoanRequest = parameters.indexOf('serialloanrequest=true') !== -1;
if (isDocDelivery) {
if (isSerialLoanRequest){
requiredFields = requiredFieldsLoanReqDocDelivery.serialRequest;
} else {
requiredFields = requiredFieldsLoanReqDocDelivery.noSerialRequest;
}
hideElement('#requestCited');
hideElement('input[value^="Cancel"]');
//Hide buttons that no longer work
hideElement('#buttonCancel');
// show and hide appropriate elements
showDocDeliveryFormElements();
hideNonDocDeliveryFormElements();
$('input[name="ItemInfo1"]').attr('value', 'DocDeliveryPublic');
//If both catalog and document delivery parameters are present, add doc delivery to form for automatic routing
let isCatalog = parameters.indexOf('catalog=true') !== -1;
if (isCatalog) {
$('input[name="ItemInfo1"]').attr('value', 'DocDelivery');
}
$('#pageHeader').html("UA Materials Express (Place Items on Hold for Pickup or Delivery)");
$('#pageHeader').after('<p id="pageIntroduction">Use this form to request items you want to check out from the University Libraries (this includes Archival Facility requests). Faculty can choose to have items delivered to their campus mailbox via intracampus mail. You may be able to select a pickup library for an item depending on the type of the request.</p>');
$('#facOrGrad').change(function () {
$.proxy(facOrGradChange, $('#facOrGrad'))();
});
//Campus mailbox
$('#ItemInfo3').change(function () {
$.proxy(campusMailboxChange, $('#ItemInfo3'))();
});
//Pickup library
$('#ItemInfo4').change(function () {
$.proxy(pickupLibraryChange, $('#ItemInfo4'))();
});
//Archival Facility request
$('#itemInfo5').change(function () {
$.proxy(annexRequestChange, $('#itemInfo5'))();
});
//Serial loan request
$('#itemInfo2').change(function () {
$.proxy(serialLoanChange, $('#itemInfo2'))();
});
} else {
requiredFields = requiredFieldsLoanReq;
}
// add 'required' attribute to all required fields
requiredFields.forEach(field => {
makeRequired(field);
});
if (isSerialLoanRequest) {
$('#itemInfo2').val(function (index, value) {
return "Yes"
});
$('#itemInfo2').change();
}
// add event handler for form
$('#LoanRequestForm').submit(function (event) {
//Validate form, etc.
let 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>
</html>