Owen Leonard
d10ce467f5
This patch fixes some inconsistencies in the item search fields administration page, making sure the page title, breadcrumb navigation, and page headers are consistent with each other. The patch makes some changes to the way new item search fields are added in order to keep the display consistent with other similar interfaces: The "add" form is no longer shown dynamically from the page listing item search fields. Clicking the "New search field" toolbar button will now take you to the same template used for editing existing search fields. This allows us to put the correct context into page title, breadcrumbs, and headings. To test, apply the patch and go to Administration -> Item search fields. Test the process of adding a new search field and editing an existing search field. Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
31 lines
880 B
JavaScript
31 lines
880 B
JavaScript
/* global _ MSG_ITEM_SEARCH_DELETE_CONFIRM */
|
|
|
|
jQuery.validator.addMethod("marcfield", function(value, element) {
|
|
return this.optional(element) || /^[0-9a-zA-Z]+$/.test(value);
|
|
}, __("Please enter letters or numbers") );
|
|
|
|
$(document).ready(function(){
|
|
$(".field-delete").on("click",function(){
|
|
$(this).parent().parent().addClass("highlighted-row");
|
|
if (confirm( __("Are you sure you want to delete this field?") )) {
|
|
return true;
|
|
} else {
|
|
$(this).parent().parent().removeClass("highlighted-row");
|
|
return false;
|
|
}
|
|
});
|
|
|
|
$("#search_fields").validate({
|
|
rules: {
|
|
label: "required",
|
|
tagfield: {
|
|
required: true,
|
|
marcfield: true
|
|
},
|
|
tagsubfield: {
|
|
marcfield: true
|
|
}
|
|
}
|
|
});
|
|
|
|
});
|