Lines 149-154
$(document).ready(function()
Link Here
|
149 |
}); |
149 |
}); |
150 |
//]]> |
150 |
//]]> |
151 |
</script> |
151 |
</script> |
|
|
152 |
<script language="javascript"> |
153 |
var maximum_budget = 1; |
154 |
|
155 |
function addRow(tableID) { |
156 |
maximum_budget++; |
157 |
document.getElementById('max_budget').value = maximum_budget; |
158 |
var table = document.getElementById(tableID); |
159 |
var rowCount = table.rows.length; |
160 |
var row = table.insertRow(rowCount); |
161 |
var cell1 = row.insertCell(0); |
162 |
var element1 = document.createElement("input"); |
163 |
element1.type = "checkbox"; |
164 |
element1.name="chkbox[]"; |
165 |
cell1.appendChild(element1); |
166 |
|
167 |
var cell2 = row.insertCell(1); |
168 |
var b_id = 'b' + maximum_budget; |
169 |
var createSelect = "<select name='" + b_id +"'"+ "id='" + b_id +"'>"; |
170 |
var createOption = ""; |
171 |
var object1 = document.getElementById('budget_id'); |
172 |
for (i = 1; i < object1.options.length; i++) { |
173 |
createOption = createOption + "<option value ='" + object1.options[i].value+"'>"+object1.options[i].text + "</option>"; |
174 |
|
175 |
} |
176 |
|
177 |
createSelect = createSelect + createOption + "</select>"; |
178 |
cell2.innerHTML = createSelect; |
179 |
var cell3 = row.insertCell(2); |
180 |
var element2 = document.createElement("input"); |
181 |
var q_id = 'q' + maximum_budget; |
182 |
element2.type = "text"; |
183 |
element2.name = q_id; |
184 |
element2.id= q_id; |
185 |
element2.value = 1; |
186 |
cell3.appendChild(element2); |
187 |
} |
188 |
|
189 |
function deleteRow(tableID) { |
190 |
try { |
191 |
var table = document.getElementById(tableID); |
192 |
var rowCount = table.rows.length; |
193 |
var checkedRowCount = 1; |
194 |
for(var i=0; i<rowCount; i++) { |
195 |
var row = table.rows[i]; |
196 |
var chkbox = row.cells[0].childNodes[0]; |
197 |
if(null != chkbox && true == chkbox.checked) { |
198 |
checkedRowCount ++; |
199 |
} |
200 |
} |
201 |
|
202 |
for(var i=0; i<rowCount; i++) { |
203 |
var row = table.rows[i]; |
204 |
var chkbox = row.cells[0].childNodes[0]; |
205 |
if(null != chkbox && true == chkbox.checked) { |
206 |
table.deleteRow(i); |
207 |
rowCount--; |
208 |
i--; |
209 |
} |
210 |
} |
211 |
} catch(e) { |
212 |
alert(e); |
213 |
} |
214 |
} |
215 |
</script> |
152 |
</head> |
216 |
</head> |
153 |
<body id="acq_neworderempty" class="acq"> |
217 |
<body id="acq_neworderempty" class="acq"> |
154 |
|
218 |
|
Lines 391-403
$(document).ready(function()
Link Here
|
391 |
[% END %][%# IF (AcqCreateItemOrdering) %] |
455 |
[% END %][%# IF (AcqCreateItemOrdering) %] |
392 |
<fieldset class="rows"> |
456 |
<fieldset class="rows"> |
393 |
<legend>Accounting Details</legend> |
457 |
<legend>Accounting Details</legend> |
394 |
<ol> |
458 |
<ol>[% IF ( biblionumber ) %] [% ELSE %] |
395 |
<li> |
459 |
<input type="button" value="Add fund and quantity" onclick="addRow('dataTable')" /> |
396 |
[% IF ( close ) %] |
460 |
<input type="button" value="Delete fund and quantity" onclick="deleteRow('dataTable')" /> |
397 |
<span class="label required">Quantity: </span> |
461 |
<input type="hidden" size="20" name="max_budget" id ="max_budget" value= 1 /> |
|
|
462 |
[% END %] |
463 |
<table id="dataTable" width="350px" border="1"> |
464 |
<tr> |
465 |
<td></td> |
466 |
<td><label class="required" for="budget_id">Fund: </label></td> |
467 |
<td><label class="required" for="quantity">Quantity: </label></td> |
468 |
</tr> |
469 |
<tr> |
470 |
<td> </td> |
471 |
<td> [% IF ( close ) %] |
472 |
<input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %] |
473 |
[% ELSE %] |
474 |
<select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> |
475 |
<option value="">Select a budget</option> |
476 |
[% FOREACH budget_loo IN budget_loop %] |
477 |
[% IF ( budget_loo.b_sel ) %] |
478 |
<option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option> |
479 |
[% ELSE %] |
480 |
[% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option> |
481 |
[% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option> |
482 |
[% END %] |
483 |
[% END %] |
484 |
[% END %] |
485 |
</select> [% END %]</td> |
486 |
<td> [% IF ( close ) %] |
398 |
<input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %] |
487 |
<input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %] |
399 |
[% ELSE %] |
488 |
[% ELSE %] |
400 |
<label class="required" for="quantity">Quantity: </label> |
|
|
401 |
[% IF (AcqCreateItemOrdering) %] |
489 |
[% IF (AcqCreateItemOrdering) %] |
402 |
[% IF subscriptionid %] |
490 |
[% IF subscriptionid %] |
403 |
<input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" /> |
491 |
<input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" /> |
Lines 413-441
$(document).ready(function()
Link Here
|
413 |
[% END %] |
501 |
[% END %] |
414 |
[% END %] |
502 |
[% END %] |
415 |
<!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order --> |
503 |
<!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order --> |
416 |
<input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" /> |
504 |
<input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" /></td> |
417 |
</li> |
505 |
</tr> |
418 |
<li> |
506 |
</table> |
419 |
[% IF ( close ) %] |
|
|
420 |
<span class="label required">Fund: </span> |
421 |
<input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %] |
422 |
[% ELSE %] |
423 |
<label class="required" for="budget_id">Fund: </label> |
424 |
<select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> |
425 |
<option value="">Select a budget</option> |
426 |
[% FOREACH budget_loo IN budget_loop %] |
427 |
[% IF ( budget_loo.b_sel ) %] |
428 |
<option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option> |
429 |
[% ELSE %] |
430 |
[% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option> |
431 |
[% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option> |
432 |
[% END %] |
433 |
[% END %] |
434 |
[% END %] |
435 |
</select> |
436 |
<label for="showallbudgets" style="float:none;width:auto;"> Show all:</label> |
437 |
<input type="checkbox" id="showallbudgets" /> |
438 |
[% END %] |
439 |
</li> |
507 |
</li> |
440 |
<li> |
508 |
<li> |
441 |
[% IF ( close ) %] |
509 |
[% IF ( close ) %] |
442 |
- |
|
|