patron search inactive flag
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 21:34:19 +0000 (21:34 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 21:34:19 +0000 (21:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5199 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/search_form.js
Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul
Open-ILS/xul/staff_client/server/patron/search_result.js

index 2bbce28..bcc8926 100644 (file)
@@ -184,6 +184,7 @@ patron.search_form.prototype = {
                                                        };
                                                }
                                        ],
+                                       'inactive' : [ ['render'], function(e) { return function() {}; } ],
                                }
                        }
                );
@@ -217,8 +218,13 @@ patron.search_form.prototype = {
                                } else {
                                        query += '&';
                                }
-                               query += id + '=' + window.escape(node.value);
-                               dump('id = ' + id + '  value = ' + node.value + '\n');
+                               if (id == 'inactive') {
+                                       query += id + '=' + window.escape(node.getAttribute('value'));
+                                       dump('id = ' + id + '  value = ' + node.getAttribute('value') + '\n');
+                               } else {
+                                       query += id + '=' + window.escape(node.value);
+                                       dump('id = ' + id + '  value = ' + node.value + '\n');
+                               }
                        }
                }
                if (typeof obj.on_submit == 'function') {
index d9a287d..8535f7b 100644 (file)
                <column id="psc2" flex="1"/>
        </columns>
        <rows id="psr">
+               <row>
+                       <spacer />
+                       <hbox>
+                               <label control="inactive" accesskey="I" value="Include inactive patrons?"/>
+                               <checkbox id="inactive" value="unchecked" oncommand="if (this.getAttribute('value') == 'unchecked') this.setAttribute('value','checked'); else this.setAttribute('value','unchecked');"/>
+                       </hbox>
+               </row>
                <row id="psr1">
                        <label id="psl1" control="family_name" 
                                value="&staff.patron_search_form.family_name.label;" 
index 80b3bae..eec6908 100644 (file)
@@ -25,7 +25,7 @@ patron.search_result.prototype = {
                JSAN.use('patron.util');
                var columns = patron.util.columns(
                        {
-                               'active' : { 'hidden' : 'false' },
+                               /* 'active' : { 'hidden' : 'false' }, */
                                'barred' : { 'hidden' : 'false' },
                                'family_name' : { 'hidden' : 'false' },
                                'first_given_name' : { 'hidden' : 'false' },
@@ -101,6 +101,7 @@ patron.search_result.prototype = {
                var obj = this;
                var search_hash = {};
                obj.search_term_count = 0;
+               var inactive = false;
                for (var i in query) {
                        switch( i ) {
                                case 'phone': case 'ident': 
@@ -126,17 +127,25 @@ patron.search_result.prototype = {
                                        search_hash[i].group = 0; 
                                        obj.search_term_count++;
                                break;
+
+                               case 'inactive':
+                                       if (query[i] == 'checked') inactive = true;
+                               break;
                        }
                }
                try {
                        var results = [];
 
+                       var params = [ ses(), search_hash, 1000, [ 'family_name ASC', 'first_given_name ASC', 'second_given_name ASC', 'dob DESC' ] ];
+                       if (inactive) {
+                               params.push(1);
+                               if (document.getElementById('active')) {
+                                       document.getElementById('active').setAttribute('hidden','false');
+                                       document.getElementById('active').hidden = false;
+                               }
+                       }
                        if (obj.search_term_count > 0) {
-                               results = this.network.request(
-                                       api.FM_AU_IDS_RETRIEVE_VIA_HASH.app,
-                                       api.FM_AU_IDS_RETRIEVE_VIA_HASH.method,
-                                       [ ses(), search_hash, 1000, [ 'family_name ASC', 'first_given_name ASC', 'second_given_name ASC', 'dob DESC' ] ]
-                               );
+                               results = this.network.simple_request( 'FM_AU_IDS_RETRIEVE_VIA_HASH', params );
                                if ( (results == null) || (typeof results.ilsevent != 'undefined') ) throw(results);
                        }