Bug 16681 - Allow update of opacnote via batch patron modification tool
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / modborrowers.tt
index 6868f23..54227e6 100644 (file)
@@ -3,7 +3,7 @@
 <title>Koha &rsaquo; Tools &rsaquo; Batch patron modification</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
 [% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
                 }));
                 $("#selectallbutton").click(function() {
                     $("#borrowerst").find("input:checkbox").each(function() {
-                        $(this).attr("checked", true);
+                        $(this).prop("checked", true);
                     });
                     return false;
                 });
                 $("#clearallbutton").click(function() {
                     $("#borrowerst").find("input:checkbox").each(function() {
-                        $(this).attr("checked", false);
+                        $(this).prop("checked", false);
                     });
                     return false;
                 });
@@ -85,7 +85,7 @@
             var li_node = $("li.attributes:last");
             var li_clone = $(li_node).clone();
             if ( $(li_clone).find("a.delete").length == 0 ) {
-                $(li_clone).append('<a href="#" title="Delete" class="delete clear-field" onclick="del_attributes(this);return false;">Delete</a>');
+                $(li_clone).append('<a href="#" title="Delete" class="delete" onclick="del_attributes(this);return false;"><i class="fa fa-fw fa-trash"></i> Delete</a>');
             }
             $(li_clone).find('select[name="patron_attributes"]').change(function() {
                 updateAttrValues(this);
 //]]>
 </script>
 </head>
-<body>
+<body id="tools_modborrowers" class="tools">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
                 </form>
                 [% END %]
 
+                [% IF ( op == 'show') && (!borrowers) && (!notfoundcardnumbers) # Alert if no patrons given%]
+                    [% op = 'noshow' # Change op to prevent display in code below %]
+                    <h1>Batch patrons modification</h1>
+                    <div class="dialog alert">
+                        <p>No patron card numbers given.</p>
+                        <form action="/cgi-bin/koha/tools/modborrowers.pl" method="get">
+                         <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
+                        </form>
+                    </div>
+                [% END #Alert if no patrons %]
+
                 [% IF ( op == 'show' or op == 'show_results' ) %]
                     [% IF ( op == 'show' ) %]
                         <h1>Batch patrons modification</h1>
                             <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="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a></div>
                         [% END %]
                     [% END %]
                         [% IF borrowers %]
                                                 <th>Category</th>
                                                 <th>City</th>
                                                 <th>State</th>
-                                                <th>Zip/Postal code</th>
+                                                <th>ZIP/Postal code</th>
                                                 <th>Country</th>
                                                 <th class="title-string">Registration date</th>
                                                 <th class="title-string">Expiry date</th>
+                                                <th>Circulation note</th>
+                                                <th>Opac Note</th>
                                                 [% FOREACH attrh IN attributes_header %]
                                                     <th>[% attrh.attribute %]</th>
                                                 [% END %]
                                                     <td>[% borrower.country %]</td>
                                                     <td><span title="[% borrower.dateenrolled %]">[% borrower.dateenrolled | $KohaDates %]</span></td>
                                                     <td><span title="[% borrower.dateexpiry %]">[% borrower.dateexpiry | $KohaDates %]</span></td>
+                                                    <td>[% borrower.borrowernotes %]</td>
+                                                    <td>[% borrower.opacnote %]</td>
                                                     [% FOREACH pa IN borrower.patron_attributes %]
                                                         [% IF ( pa.code ) %]
                                                             <td>[% pa.code %]=[% pa.value %]</td>
                                                 [% CASE 'state' %]
                                                 State
                                                 [% CASE 'zipcode' %]
-                                                Zip/Postal code
+                                                ZIP/Postal code
                                                 [% CASE 'country' %]
                                                 Country
                                                 [% CASE 'sort1' %]
                                                 Expiry date:
                                                 [% CASE 'borrowernotes' %]
                                                 Circulation note:
+                                                [% CASE 'opacnote' %]
+                                                OPAC note:
                                             [% END %]
                                             </label>
                                             [% IF field.mandatory %]
                                             [% END %]
                                             [% 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>
+                                                <a href="#" onclick="clearDate('[% field.name %]');return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
                                             [% END %]
                                             [% IF field.mandatory %]
                                                 <span class="required">Required fields cannot be cleared</span>
                                                 </label>
                                                 <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
                                                 <span class="patron_attributes_value"></span>
-                                                <a href="#" class="clone-field" title="Add an attribute" onclick="add_attributes(); return false;">New</a>
+                                                <a href="#" title="Add an attribute" onclick="add_attributes(); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
                                                 <span class="information_category hint" style="width:25%;float:right;"></span>
                                             </li>
                                         [% END %]
                 [% INCLUDE 'tools-menu.inc' %]
             </div>
         </div>
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' %]