|
Lines 7-29
Link Here
|
| 7 |
<script type="text/javascript"> |
7 |
<script type="text/javascript"> |
| 8 |
//<![CDATA[ |
8 |
//<![CDATA[ |
| 9 |
$(document).ready(function() { |
9 |
$(document).ready(function() { |
| 10 |
$("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); |
|
|
| 11 |
$("#guarantordelete").click(function() { |
| 12 |
$("#contact-details").hide().find('a').remove(); |
| 13 |
$("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" }); |
| 14 |
$("#contactname, #contactfirstname") |
| 15 |
.each(function () { this.type = 'text' }) |
| 16 |
.parent().find('span').remove(); |
| 17 |
$("#guarantorsearch").val(_("Set to patron")); |
| 18 |
}); |
| 19 |
$("#select_city").change(function(){ |
| 20 |
var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/); |
| 21 |
document.form.select_city.value.match(myRegEx); |
| 22 |
document.form.zipcode.value=RegExp.$1; |
| 23 |
document.form.city.value=RegExp.$2; |
| 24 |
document.form.state.value=RegExp.$3; |
| 25 |
document.form.country.value=RegExp.$4; |
| 26 |
}); |
| 27 |
|
10 |
|
| 28 |
[% IF categorycode %] |
11 |
[% IF categorycode %] |
| 29 |
update_category_code( "[% categorycode %]" ); |
12 |
update_category_code( "[% categorycode %]" ); |
|
Lines 33-152
Link Here
|
| 33 |
update_category_code( category_code ); |
16 |
update_category_code( category_code ); |
| 34 |
} |
17 |
} |
| 35 |
[% END %] |
18 |
[% END %] |
| 36 |
$("#dateofbirth").datepicker({ maxDate: "-1D", yearRange: "c-120:" }); |
|
|
| 37 |
$("#entryform").validate({ |
| 38 |
rules: { |
| 39 |
email: { |
| 40 |
email: true |
| 41 |
}, |
| 42 |
emailpro: { |
| 43 |
email: true |
| 44 |
}, |
| 45 |
B_email: { |
| 46 |
email: true |
| 47 |
} |
| 48 |
}, |
| 49 |
submitHandler: function(form) { |
| 50 |
$("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); |
| 51 |
if (form.beenSubmitted) |
| 52 |
return false; |
| 53 |
else |
| 54 |
form.beenSubmitted = true; |
| 55 |
form.submit(); |
| 56 |
} |
| 57 |
}); |
| 58 |
|
| 59 |
var mrform = $("#manual_restriction_form"); |
| 60 |
var mrlink = $("#add_manual_restriction"); |
| 61 |
mrform.hide(); |
| 62 |
mrlink.on("click",function(e){ |
| 63 |
$(this).hide(); |
| 64 |
mrform.show(); |
| 65 |
e.preventDefault(); |
| 66 |
}); |
| 67 |
$("#cancel_manual_restriction").on("click",function(e){ |
| 68 |
$('#debarred_expiration').val(''); |
| 69 |
$('#add_debarment').val(0); |
| 70 |
$('#debarred_comment').val(''); |
| 71 |
mrlink.show(); |
| 72 |
mrform.hide(); |
| 73 |
e.preventDefault(); |
| 74 |
}); |
| 75 |
}); |
19 |
}); |
| 76 |
|
20 |
|
| 77 |
function clear_entry(node) { |
|
|
| 78 |
var original = $(node).parent(); |
| 79 |
$("textarea", original).attr('value', ''); |
| 80 |
$("select", original).attr('value', ''); |
| 81 |
} |
| 82 |
|
| 83 |
function clone_entry(node) { |
| 84 |
var original = $(node).parent(); |
| 85 |
var clone = original.clone(); |
| 86 |
|
| 87 |
var newId = 50 + parseInt(Math.random() * 100000); |
| 88 |
$("input,select,textarea", clone).attr('id', function() { |
| 89 |
return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId); |
| 90 |
}); |
| 91 |
$("input,select,textarea", clone).attr('name', function() { |
| 92 |
return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId); |
| 93 |
}); |
| 94 |
$("label", clone).attr('for', function() { |
| 95 |
return $(this).attr("for").replace(/patron_attr_\d+/, 'patron_attr_' + newId); |
| 96 |
}); |
| 97 |
$("input#patron_attr_" + newId, clone).attr('value',''); |
| 98 |
$("select#patron_attr_" + newId, clone).attr('value',''); |
| 99 |
$(original).after(clone); |
| 100 |
return false; |
| 101 |
} |
| 102 |
|
| 103 |
function update_category_code(category_code) { |
| 104 |
if ( $(category_code).is("select") ) { |
| 105 |
category_code = $("#categorycode_entry").find("option:selected").val(); |
| 106 |
} |
| 107 |
var mytables = $(".attributes_table"); |
| 108 |
$(mytables).find("li").hide(); |
| 109 |
$(mytables).find(" li[data-category_code='"+category_code+"']").show(); |
| 110 |
$(mytables).find(" li[data-category_code='']").show(); |
| 111 |
} |
| 112 |
|
| 113 |
function select_user(borrowernumber, borrower) { |
| 114 |
var form = $('#entryform').get(0); |
| 115 |
if (form.guarantorid.value) { |
| 116 |
$("#contact-details").find('a').remove(); |
| 117 |
$("#contactname, #contactfirstname").parent().find('span').remove(); |
| 118 |
} |
| 119 |
|
| 120 |
var id = borrower.borrowernumber; |
| 121 |
form.guarantorid.value = id; |
| 122 |
$('#contact-details') |
| 123 |
.show() |
| 124 |
.find('span') |
| 125 |
.after('<a target="blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + id + '">' + id + '</a>'); |
| 126 |
|
| 127 |
$(form.contactname) |
| 128 |
.val(borrower.surname) |
| 129 |
.before('<span>' + borrower.surname + '</span>').get(0).type = 'hidden'; |
| 130 |
$(form.contactfirstname) |
| 131 |
.val(borrower.firstname) |
| 132 |
.before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden'; |
| 133 |
|
| 134 |
form.streetnumber.value = borrower.streetnumber; |
| 135 |
form.address.value = borrower.address; |
| 136 |
form.address2.value = borrower.address2; |
| 137 |
form.city.value = borrower.city; |
| 138 |
form.state.value = borrower.state; |
| 139 |
form.zipcode.value = borrower.zipcode; |
| 140 |
form.country.value = borrower.country; |
| 141 |
form.branchcode.value = borrower.branchcode; |
| 142 |
|
| 143 |
form.guarantorsearch.value = _("Change"); |
| 144 |
|
| 145 |
return 0; |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
var MSG_SEPARATOR = _("Separator must be / in field %s"); |
21 |
var MSG_SEPARATOR = _("Separator must be / in field %s"); |
| 151 |
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); |
22 |
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); |
| 152 |
var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s"); |
23 |
var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s"); |
|
Lines 157-162
Link Here
|
| 157 |
var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron"); |
28 |
var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron"); |
| 158 |
var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match"); |
29 |
var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match"); |
| 159 |
var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces."); |
30 |
var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces."); |
|
|
31 |
var LABEL_CHANGE = _("Change"); |
| 32 |
var LABEL_SET_TO_PATRON = _("Set to patron"); |
| 160 |
//]]> |
33 |
//]]> |
| 161 |
</script> |
34 |
</script> |
| 162 |
<script type="text/javascript" src="[% themelang %]/js/members.js"></script> |
35 |
<script type="text/javascript" src="[% themelang %]/js/members.js"></script> |
| 163 |
- |
|
|