[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › Batch patron deletion/anonymization [% IF step == 2 %]› Confirm[% END %][% IF step == 3 %]› Finished[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'calendar.inc' %]
-<script type="text/javascript">
- $(document).ready(function(){
- $("#delete_patrons_form").on("submit",function(){
- return checkForm( this );
- });
- });
-
- /**
- * checkForm(form)
- * This function check the form is correctly filled.
- */
- function checkForm(form) {
- if((form.checkbox[0].checked)){
- if ( (!form.date1.value) && (!form.borrower_dateexpiry.value) [% IF Koha.Preference('TrackLastPatronActivity') %]&& (!form.borrower_lastseen.value) [% END %]&& (!form.borrower_categorycode.value) && (!form.patron_list_id.value)){
- alert(_("Please enter at least one criterion for deletion!"));
- return false;
- }
- }
- if((form.checkbox[1].checked)){
- if(!(form.date2.value)){
- alert(_("Please enter a date!"));
- return false;
- }
- }
- if(!form.checkbox[0].checked && !form.checkbox[1].checked) {
- alert( _("Please check at least one action") );
- return false;
- }
- return true;
- }
-
- $(document).ready(function() {
- $('#branch').change(function() {
- $('#selectlibrary').submit();
- });
- });
-</script>
-
</head>
+
<body id="tools_cleanborrowers" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'tools-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
+ [% INCLUDE 'calendar.inc' %]
+ <script type="text/javascript">
+ $(document).ready(function(){
+ $("#delete_patrons_form").on("submit",function(){
+ return checkForm( this );
+ });
+
+ $('#branch').change(function() {
+ $('#selectlibrary').submit();
+ });
+ });
+
+ /**
+ * checkForm(form)
+ * This function check the form is correctly filled.
+ */
+ function checkForm(form) {
+ if((form.checkbox[0].checked)){
+ if ( (!form.date1.value) && (!form.borrower_dateexpiry.value) [% IF Koha.Preference('TrackLastPatronActivity') %]&& (!form.borrower_lastseen.value) [% END %]&& (!form.borrower_categorycode.value) && (!form.patron_list_id.value)){
+ alert(_("Please enter at least one criterion for deletion!"));
+ return false;
+ }
+ }
+ if((form.checkbox[1].checked)){
+ if(!(form.date2.value)){
+ alert(_("Please enter a date!"));
+ return false;
+ }
+ }
+ if(!form.checkbox[0].checked && !form.checkbox[1].checked) {
+ alert( _("Please check at least one action") );
+ return false;
+ }
+ return true;
+ }
+ </script>
+[% END %]
+
[% INCLUDE 'intranet-bottom.inc' %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
-[% INCLUDE 'doc-head-open.inc'%]
+[% SET footerjs = 1 %]
+[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › Batch patron modification</title>
[% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'calendar.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
-[% INCLUDE 'datatables.inc' %]
-<script type="text/javascript">
-//<![CDATA[
- var patron_attributes_lib = new Array();
- var patron_attributes_values = new Array();
- $(document).ready(function() {
- [% IF borrowers %]
- $("#borrowerst").dataTable($.extend(true, {}, dataTablesDefaults, {
- "sDom": 't',
- [% IF ( op == 'show_results' ) %]
- "aoColumnDefs": [
- { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
- ],
- [% ELSE %]
- "aoColumnDefs": [
- { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
- { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
- ],
- [% END %]
- "bPaginate": false
- }));
- $("#selectallbutton").click(function() {
- $("#borrowerst").find("input:checkbox").each(function() {
- $(this).prop("checked", true);
- });
- return false;
- });
- $("#clearallbutton").click(function() {
- $("#borrowerst").find("input:checkbox").each(function() {
- $(this).prop("checked", false);
- });
- return false;
- });
- [% END %]
-
- var values = new Array();
- var lib = new Array();
- [% FOREACH pav IN patron_attributes_values %]
- values = new Array();
- lib = new Array();
- [% FOREACH option IN pav.options %]
- values.push("[% option.lib %]");
- lib.push("[% option.authorised_value %]");
- [% END %]
- patron_attributes_lib["[% pav.attribute_code %]"] = values;
- patron_attributes_values["[% pav.attribute_code %]"] = lib;
- [% END %]
-
- $('select[name="patron_attributes"]').change(function() {
- updateAttrValues(this);
- } );
-
- $('select[name="patron_attributes"]').change();
-
- $(".clear-date").on("click",function(e){
- e.preventDefault();
- var fieldID = this.id.replace("clear-date-","");
- $("#" + fieldID).val("");
- });
- $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){
- e.preventDefault();
- add_attributes();
- });
- $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){
- e.preventDefault();
- del_attributes(this);
- });
- });
-
- function updateAttrValues (select_attr) {
- var attr_code = $(select_attr).val();
- var type = $(select_attr).find("option:selected").attr('data-type');
- var category = $(select_attr).find("option:selected").attr('data-category');
- var span = $(select_attr).parent().parent().find('span.patron_attributes_value');
- var information_category_node = $(select_attr).parent().parent().find('span.information_category');
- information_category_node.html("");
- if ( category.length > 0 ) {
- information_category_node.html(_("This attribute will be only applied to the patron's category %s").format(category));
- }
- if ( type == 'select' ) {
- var options = '<option value = ""></option>';
- for ( var i = 0 ; i < patron_attributes_values[attr_code].length ; i++ ) {
- options += '<option value="'+patron_attributes_values[attr_code][i]+'">'+patron_attributes_lib[attr_code][i]+'</option>';
- }
- span.html('<select name="patron_attributes_value">' + options + '</select>');
- } else {
- span.html('<input type="text" name="patron_attributes_value"/>')
- }
- }
-
- function add_attributes() {
- var li_node = $("li.attributes:last");
- var li_clone = $(li_node).clone();
- if ( $(li_clone).find("a.del_attributes").length == 0 ) {
- $(li_clone).append('<a href="#" title="Delete" class="del_attributes"><i class="fa fa-fw fa-trash"></i> Delete</a>');
- }
- $(li_clone).find('select[name="patron_attributes"]').change(function() {
- updateAttrValues(this);
- } );
-
- $(li_clone).find('select[name="patron_attributes"]').change();
-
- $("#fields_list>ol").append(li_clone);
- update_attr_values();
- }
-
- function del_attributes(a_node) {
- $(a_node).parent('li').remove();
- update_attr_values();
- }
-
- function update_attr_values() {
- $("li.attributes").each(function(i) {
- $(this).find("input:checkbox").val("attr"+i+"_value");
- });
- }
- function clearDate(nodeid) {
- $("#"+nodeid).val("");
- }
-
-//]]>
-</script>
</head>
+
<body id="tools_modborrowers" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'tools-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ [% INCLUDE 'calendar.inc' %]
+ [% INCLUDE 'datatables.inc' %]
+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
+ <script type="text/javascript">
+ var patron_attributes_lib = new Array();
+ var patron_attributes_values = new Array();
+ $(document).ready(function() {
+ [% IF borrowers %]
+ $("#borrowerst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "sDom": 't',
+ [% IF ( op == 'show_results' ) %]
+ "aoColumnDefs": [
+ { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
+ ],
+ [% ELSE %]
+ "aoColumnDefs": [
+ { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+ { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
+ ],
+ [% END %]
+ "bPaginate": false
+ }));
+ $("#selectallbutton").click(function() {
+ $("#borrowerst").find("input:checkbox").each(function() {
+ $(this).prop("checked", true);
+ });
+ return false;
+ });
+ $("#clearallbutton").click(function() {
+ $("#borrowerst").find("input:checkbox").each(function() {
+ $(this).prop("checked", false);
+ });
+ return false;
+ });
+ [% END %]
+
+ var values = new Array();
+ var lib = new Array();
+ [% FOREACH pav IN patron_attributes_values %]
+ values = new Array();
+ lib = new Array();
+ [% FOREACH option IN pav.options %]
+ values.push("[% option.lib %]");
+ lib.push("[% option.authorised_value %]");
+ [% END %]
+ patron_attributes_lib["[% pav.attribute_code %]"] = values;
+ patron_attributes_values["[% pav.attribute_code %]"] = lib;
+ [% END %]
+
+ $('select[name="patron_attributes"]').change(function() {
+ updateAttrValues(this);
+ } );
+
+ $('select[name="patron_attributes"]').change();
+
+ $(".clear-date").on("click",function(e){
+ e.preventDefault();
+ var fieldID = this.id.replace("clear-date-","");
+ $("#" + fieldID).val("");
+ });
+ $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){
+ e.preventDefault();
+ add_attributes();
+ });
+ $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){
+ e.preventDefault();
+ del_attributes(this);
+ });
+ });
+
+ function updateAttrValues (select_attr) {
+ var attr_code = $(select_attr).val();
+ var type = $(select_attr).find("option:selected").attr('data-type');
+ var category = $(select_attr).find("option:selected").attr('data-category');
+ var span = $(select_attr).parent().parent().find('span.patron_attributes_value');
+ var information_category_node = $(select_attr).parent().parent().find('span.information_category');
+ information_category_node.html("");
+ if ( category.length > 0 ) {
+ information_category_node.html(_("This attribute will be only applied to the patron's category %s").format(category));
+ }
+ if ( type == 'select' ) {
+ var options = '<option value = ""></option>';
+ for ( var i = 0 ; i < patron_attributes_values[attr_code].length ; i++ ) {
+ options += '<option value="'+patron_attributes_values[attr_code][i]+'">'+patron_attributes_lib[attr_code][i]+'</option>';
+ }
+ span.html('<select name="patron_attributes_value">' + options + '</select>');
+ } else {
+ span.html('<input type="text" name="patron_attributes_value"/>')
+ }
+ }
+
+ function add_attributes() {
+ var li_node = $("li.attributes:last");
+ var li_clone = $(li_node).clone();
+ if ( $(li_clone).find("a.del_attributes").length == 0 ) {
+ $(li_clone).append('<a href="#" title="Delete" class="del_attributes"><i class="fa fa-fw fa-trash"></i> Delete</a>');
+ }
+ $(li_clone).find('select[name="patron_attributes"]').change(function() {
+ updateAttrValues(this);
+ } );
+
+ $(li_clone).find('select[name="patron_attributes"]').change();
+
+ $("#fields_list>ol").append(li_clone);
+ update_attr_values();
+ }
+
+ function del_attributes(a_node) {
+ $(a_node).parent('li').remove();
+ update_attr_values();
+ }
+
+ function update_attr_values() {
+ $("li.attributes").each(function(i) {
+ $(this).find("input:checkbox").val("attr"+i+"_value");
+ });
+ }
+ function clearDate(nodeid) {
+ $("#"+nodeid).val("");
+ }
+ </script>
+[% END %]
+
[% INCLUDE 'intranet-bottom.inc' %]