Bug 11929: patron modification error shows borrowernumber
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / modborrowers.tt
index af5040d..65ce440 100644 (file)
@@ -3,22 +3,26 @@
 <title>Koha &rsaquo; Tools &rsaquo; Batch patron modification</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" />
-<script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
-[% INCLUDE 'datatables-strings.inc' %]
-<script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
-    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
         var patron_attributes_lib = new Array();
         var patron_attributes_values = new Array();
         $(document).ready(function() {
             [% IF borrowers %]
                 $("#borrowerst").dataTable($.extend(true, {}, dataTablesDefaults, {
                     "sDom": 't',
-                    "aoColumnDefs": [
-                        { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
-                    ],
+                    [% 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() {
@@ -64,7 +68,7 @@
             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") +' "' + category + '"');
+                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>';
 //]]>
 </script>
 </head>
-<body>
+<body id="tools_modborrowers" class="tools">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
                     [% IF ( op == 'show_results' ) %]
                         [% IF ( errors ) %]
                             <div class="dialog alert">
-                            <h4>Errors occured:</h4>
+                            <h4>Errors occurred:</h4>
                             <ul class="warnings">
                             [% FOREACH error IN errors %]
                                 [% IF ( error.error == 'can_not_update' ) %]
-                                    <li>Can not update patron with borrowernumber [% error.borrowernumber %]</li>
+                                    <li>Can not update patron.
+                                    [% IF ( error.cardnumber ) %] Cardnumber:  [% error.cardnumber %] [% END %]
+                                    (Borrowernumber: [% error.borrowernumber %])
+                                    </li>
                                 [% ELSE %]
                                     <li>[% error.error %]</li>
                                 [% END %]
                     <form name="f" action="modborrowers.pl" method="post">
                         <input type="hidden" name="op" value="do" />
                         [% IF ( borrowers ) %]
-                            <div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>
+                            <div id="toolbar"><a id="selectallbutton" href="#">Select all</a> | <a id="clearallbutton" href="#">Clear all</a></div>
                         [% END %]
                     [% END %]
                         [% IF borrowers %]
                                                 [% END %]
                                                 <th>Card number</th>
                                                 <th>Surname</th>
-                                                <th>Firstname</th>
+                                                <th>First name</th>
                                                 <th>Library</th>
                                                 <th>Category</th>
-                                                <th>Registration date</th>
-                                                <th>Expiry date</th>
+                                                <th>City</th>
+                                                <th>State</th>
+                                                <th>Zip/Postal code</th>
+                                                <th>Country</th>
+                                                <th class="title-string">Registration date</th>
+                                                <th class="title-string">Expiry date</th>
                                                 [% FOREACH attrh IN attributes_header %]
                                                     <th>[% attrh.attribute %]</th>
                                                 [% END %]
                                                     <td>[% borrower.firstname %]</td>
                                                     <td>[% borrower.branchname %]</td>
                                                     <td>[% borrower.categorycode %]</td>
-                                                    <td>[% borrower.dateenrolled | $KohaDates %]</td>
-                                                    <td>[% borrower.dateexpiry | $KohaDates %]</td>
+                                                    <td>[% borrower.city %]</td>
+                                                    <td>[% borrower.state %]</td>
+                                                    <td>[% borrower.zipcode %]</td>
+                                                    <td>[% borrower.country %]</td>
+                                                    <td><span title="[% borrower.dateenrolled %]">[% borrower.dateenrolled | $KohaDates %]</span></td>
+                                                    <td><span title="[% borrower.dateexpiry %]">[% borrower.dateexpiry | $KohaDates %]</span></td>
                                                     [% FOREACH pa IN borrower.patron_attributes %]
                                                         [% IF ( pa.code ) %]
                                                             <td>[% pa.code %]=[% pa.value %]</td>
 
                             [% IF ( op == 'show' ) %]
                             <div id="cataloguing_additem_newitem">
-                                <h2>Edit Patrons</h2>
-                                <div class="hint">Checking the box right next the label will disable the entry and delete the values of that field on all selected patrons</div>
+                                <h2>Edit patrons</h2>
+                                <div class="hint">Checking the box right next to the label will disable the entry and delete the values of that field on all selected patrons</div>
                                 <fieldset class="rows" id="fields_list">
                                     <ol>
                                         [% FOREACH field IN fields %]
                                                 Library:
                                                 [% CASE 'categorycode' %]
                                                 Category
+                                                [% CASE 'city' %]
+                                                City
+                                                [% CASE 'state' %]
+                                                State
+                                                [% CASE 'zipcode' %]
+                                                Zip/Postal code
+                                                [% CASE 'country' %]
+                                                Country
                                                 [% CASE 'sort1' %]
                                                 Sort 1:
                                                 [% CASE 'sort2' %]
                                             [% IF ( field.type == 'date' ) %]
                                                 <input type="text" name="[% field.name %]" id="[% field.name %]" value="" size="10" maxlength="10" readonly="readonly" class="datepicker" />
                                                 <a href="#" class="clear-field" onclick="clearDate('[% field.name %]');return false;">Clear</a>
-                                                [% END %]
+                                            [% END %]
+                                            [% IF field.mandatory %]
+                                                <span class="required">Required fields cannot be cleared</span>
+                                            [% END %]
                                         </li>
                                         [% END %]
                                         [% IF ( patron_attributes_codes ) %]
                 [% INCLUDE 'tools-menu.inc' %]
             </div>
         </div>
-    </div>
-</div>
-</body>
-</html>
+[% INCLUDE 'intranet-bottom.inc' %]