"Select All" option in invoice search results
authorBill Erickson <berick@esilibrary.com>
Fri, 28 Sep 2012 20:53:05 +0000 (16:53 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 5 Oct 2012 20:28:02 +0000 (16:28 -0400)
Adds a new Select All checkbox along the top of the invoice search
results page.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/acq/invoice/view.tt2
Open-ILS/web/js/ui/default/acq/invoice/view.js

index c1a7aa7..27f2916 100644 (file)
                             </td>
                         </tr></table>
                     </div> <!-- end search form -->
+                    <div style='border-bottom:1px solid #888;'>
+                        <input type='checkbox' onclick='selectSearchResults()'>&nbsp;[% l('Select All') %]</input>
+                    </div>
                     <div id='acq-unified-results-no_results'>
                         <b>[% l('No Results') %]</b>
                     </div>
index bd1ff0a..2036f6f 100644 (file)
@@ -411,11 +411,19 @@ function addSelectedToInvoice() {
     doAttachLi(true);
 }
 
+allResSelected = false;
 function clearSearchResTable() {
+    allResSelected = false;
     while (resultsTbody.childNodes[0])
         resultsTbody.removeChild(resultsTbody.childNodes[0]);
 }
 
+function selectSearchResults() {
+    allResSelected = !allResSelected;
+    dojo.query('[name=search-results-checkbox]').forEach(
+        function(input) { input.checked = allResSelected });
+}
+
 function updateTotalCost() {
 
     var totalCost = 0;