[open-ils-commits] [GIT] Evergreen ILS branch master updated. 5f798af865fdd0d30fa29d95f181df0ad2d43a64

Evergreen Git git at git.evergreen-ils.org
Tue Sep 20 11:35:35 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  5f798af865fdd0d30fa29d95f181df0ad2d43a64 (commit)
       via  6622633d58332ff9ebf1f7247e8f7fe74fce63a4 (commit)
       via  3745fe23d7ef465a1f6164ec67b9215af3a4c0f7 (commit)
       via  183eaa9491bfe876a6be9558ac16c7f307d7c4ee (commit)
       via  bab0eb7e00016f6a05db8251c2f75b00f0e8c235 (commit)
       via  f24c07b0c98d3647b144f8a93674b2ee0ecb10ce (commit)
      from  6eac593d2abbb661b58ed8b91c09f91cc58c03f3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5f798af865fdd0d30fa29d95f181df0ad2d43a64
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Fri Sep 9 16:09:33 2011 -0400

    make it obvious that Request Type is required in Create Request dialog
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 97875ee..54a352c 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -5830,7 +5830,7 @@ SELECT  usr,
 		<fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
 			<field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
 			<field reporter:label="User" name="usr" reporter:datatype="link" />
-			<field reporter:label="Request Type" name="request_type" reporter:datatype="link" />
+			<field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
 			<field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
 			<field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
 			<field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />

commit 6622633d58332ff9ebf1f7247e8f7fe74fce63a4
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Jul 28 08:16:22 2011 -0400

    acq user requests link from patron display
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 966e8f2..16b3325 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -3227,6 +3227,8 @@
 <!ENTITY staff.patron.info.stat_cats.accesskey "S">
 <!ENTITY staff.patron.info.surveys.label "Surveys">
 <!ENTITY staff.patron.info.surveys.accesskey "y">
+<!ENTITY staff.patron.info.acq_requests.label "Acquisition Requests">
+<!ENTITY staff.patron.info.acq_requests.accesskey "q">
 <!ENTITY staff.patron.info.group.label "Group Member Details">
 <!ENTITY staff.patron.info.group.accesskey "G">
 <!ENTITY staff.patron.search_form_overlay.inactive.value "Include inactive patrons?">
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index 9413809..257dea7 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -499,5 +499,6 @@ var urls = {
     'XUL_LOCAL_ADMIN_BASE' : '/xul/server/admin',
     'XUL_REPORTS' : '/reports/oils_rpt.xhtml',
     'EG_ACQ_PO_VIEW' : '/eg/acq/po/view',
+    'EG_ACQ_USER_REQUESTS' : '/eg/acq/picklist/user_request',
     'XUL_SERIAL_BATCH_RECEIVE': '/xul/server/serial/batch_receive.xul'
 }
diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js
index 29ad28d..3cf9f96 100644
--- a/Open-ILS/xul/staff_client/server/patron/display.js
+++ b/Open-ILS/xul/staff_client/server/patron/display.js
@@ -370,6 +370,19 @@ patron.display.prototype = {
                             );
                         }
                     ],
+                    'cmd_patron_info_acq_requests' : [
+                        ['command'],
+                        function(ev) {
+                            obj.right_deck.set_iframe(
+                                urls.EG_ACQ_USER_REQUESTS + '?usr=' + obj.patron.id(),
+                                {},
+                                {
+                                    'get_barcodes' : function(a) { return xulG.get_barcodes(a); }
+                                }
+                            );
+                        }
+                    ],
+
                     'cmd_patron_info_groups' : [
                         ['command'],
                         function(ev) {
diff --git a/Open-ILS/xul/staff_client/server/patron/display.xul b/Open-ILS/xul/staff_client/server/patron/display.xul
index 6023045..0d3c8d6 100644
--- a/Open-ILS/xul/staff_client/server/patron/display.xul
+++ b/Open-ILS/xul/staff_client/server/patron/display.xul
@@ -100,6 +100,7 @@
         <command id="cmd_patron_info_triggered_events" />
         <command id="cmd_patron_info_stats" />
         <command id="cmd_patron_info_surveys" />
+        <command id="cmd_patron_info_acq_requests" />
         <command id="cmd_patron_info_groups" />
         <command id="cmd_patron_other" />
         <command id="cmd_patron_alert" />
diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
index d37dbb4..bbd1b5c 100644
--- a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
+++ b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
@@ -100,6 +100,7 @@
                                         </menupopup>
                                     </menu>
                                     <menuitem label="&staff.patron.info.surveys.label;" accesskey="&staff.patron.info.surveys.accesskey;" command="cmd_patron_info_surveys"/>
+                                    <menuitem label="&staff.patron.info.acq_requests.label;" accesskey="&staff.patron.info.acq_requests.accesskey;" command="cmd_patron_info_acq_requests"/>
                                     <menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
                                     <menuitem label="&staff.patron_display.verify_password.label;" accesskey="&staff.patron_display.verify_password.accesskey;" command="cmd_verify_credentials"/>
                                     <menuitem label="&staff.main.menu.admin.user_edit.label;" accesskey="&staff.main.menu.admin.user_edit.accesskey;" command="cmd_perm_editor"/>
diff --git a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
index e94256e..03b8d41 100644
--- a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
+++ b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
@@ -100,6 +100,7 @@
                                         </menupopup>
                                     </menu>
                                     <menuitem label="&staff.patron.info.surveys.label;" accesskey="&staff.patron.info.surveys.accesskey;" command="cmd_patron_info_surveys"/>
+                                    <menuitem label="&staff.patron.info.acq_requests.label;" accesskey="&staff.patron.info.acq_requests.accesskey;" command="cmd_patron_info_acq_requests"/>
                                     <menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
                                     <menuitem label="&staff.patron_display.verify_password.label;" accesskey="&staff.patron_display.verify_password.accesskey;" command="cmd_verify_credentials"/>
                                     <menuitem label="&staff.main.menu.admin.user_edit.label;" accesskey="&staff.main.menu.admin.user_edit.accesskey;" command="cmd_perm_editor"/>

commit 3745fe23d7ef465a1f6164ec67b9215af3a4c0f7
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Jul 28 07:53:56 2011 -0400

    show acq user requests action from lineitems in lists
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2
index 268e987..8f078ab 100644
--- a/Open-ILS/src/templates/acq/common/li_table.tt2
+++ b/Open-ILS/src/templates/acq/common/li_table.tt2
@@ -105,6 +105,7 @@
                                         <span name="worksheet"> | <a title='Generate Worksheet' name="worksheet_link" href="javascript:void(0);">&#x270D; worksheet</a></span>
                                         <span name='pl' class='hidden'> | <a title='Select List' name='pl_link' href='javascript:void(0);'>&#x2756; </a></span>
                                         <span name='po' class='hidden'> | <a title='Purchase Order' name='po_link' href='javascript:void(0);'>&#x2318; </a></span>
+                                        <span name="show_requests"> | <a title='Patron Requests' name="show_requests_link" href="javascript:void(0);">requests</a></span> 
                                     </td>
                                 </tr>
                             </tbody>
diff --git a/Open-ILS/src/templates/acq/picklist/user_request.tt2 b/Open-ILS/src/templates/acq/picklist/user_request.tt2
index fe9486f..a478fdc 100644
--- a/Open-ILS/src/templates/acq/picklist/user_request.tt2
+++ b/Open-ILS/src/templates/acq/picklist/user_request.tt2
@@ -44,7 +44,7 @@
                     suppressFields='["id", "usr", "pickup_lib", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
                     fieldOrder='["title", "author", "isxn", "article_title", "article_pages", "request_type", "volume", "pubdate", "publisher", "location", "other_info", "mentioned"]'
                     editOnEnter='true'
-                    suppressEditFields='["id", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
+                    suppressEditFields='["id", "holdable_formats", "phone_notify", "email_notify", "eg_bib", "max_fee", "cancel_reason"]'
                     fmClass='aur'
                     editStyle='pane'
                     autoHeight='true'
diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js
index 3bfc4b4..23ed428 100644
--- a/Open-ILS/web/js/ui/default/acq/common/li_table.js
+++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js
@@ -297,6 +297,9 @@ function AcqLiTable() {
         nodeByName("worksheet_link", row).href =
             oilsBasePath + "/acq/lineitem/worksheet/" + li.id();
 
+        nodeByName("show_requests_link", row).href =
+            oilsBasePath + "/acq/picklist/user_request?lineitem=" + li.id();
+
         dojo.query('[attr=title]', row)[0].onclick = function() {self.drawInfo(li.id())};
         dojo.query('[name=copieslink]', row)[0].onclick = function() {self.drawCopies(li.id())};
         dojo.query('[name=noteslink]', row)[0].onclick = function() {self.drawLiNotes(li)};
diff --git a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
index 331e0d9..8e7f7c1 100644
--- a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
+++ b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
@@ -21,13 +21,8 @@ var cgi = new openils.CGI();
 
 function setup() {
 
-    if (cgi.param('eg_bib')) {
-        changeBib(cgi.param('eg_bib'));
-    }
-
-    if (cgi.param('lineitem')) {
-        changeLI(cgi.param('lineitem'));
-    }
+    changeBib(cgi.param('eg_bib'));
+    changeLI(cgi.param('lineitem'));
 
     if (cgi.param('usr')) {
         var usr_obj = fieldmapper.standardRequest(

commit 183eaa9491bfe876a6be9558ac16c7f307d7c4ee
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Jul 28 07:27:45 2011 -0400

    wire up Create Request action in acq user requests UI
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/acq/picklist/user_request.tt2 b/Open-ILS/src/templates/acq/picklist/user_request.tt2
index 9d04a16..fe9486f 100644
--- a/Open-ILS/src/templates/acq/picklist/user_request.tt2
+++ b/Open-ILS/src/templates/acq/picklist/user_request.tt2
@@ -44,7 +44,7 @@
                     suppressFields='["id", "usr", "pickup_lib", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
                     fieldOrder='["title", "author", "isxn", "article_title", "article_pages", "request_type", "volume", "pubdate", "publisher", "location", "other_info", "mentioned"]'
                     editOnEnter='true'
-                    suppressEditFields='["id"]'
+                    suppressEditFields='["id", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
                     fmClass='aur'
                     editStyle='pane'
                     autoHeight='true'
diff --git a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
index 0e67777..331e0d9 100644
--- a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
+++ b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
@@ -12,6 +12,7 @@ dojo.require('openils.acq.Lineitem');
 
 var contextOrg;
 var contextUsr;
+var contextUsrObj;
 var contextLI;
 var contextEg_bib;
 var aur_obj;
@@ -39,6 +40,7 @@ function setup() {
             }
         );
         if (typeof usr_obj.textcode == 'undefined') {
+            contextUsrObj = usr_obj;
             changeUser(usr_obj.id(),usr_obj.card().barcode());
         } else {
             alert(usr_obj.textcode + ' : ' + usr_obj.desc);
@@ -294,6 +296,7 @@ function changeUserPrompt() {
         }
     }
     if (barcode == '') {
+        contextUsrObj = null;
         changeUser('','');
     } else {
         var usr_obj = fieldmapper.standardRequest(
@@ -309,12 +312,24 @@ function changeUserPrompt() {
             alert(usr_obj.textcode + ' : ' + usr_obj.desc);
             return;
         } else {
+            contextUsrObj = usr_obj;
             changeUser(usr_obj.id(),usr_obj.card().barcode());
         }
     }
     buildGrid();
 }
 
+function createRequest() {
+    if (!contextUsr) {
+        changeUserPrompt();
+    }
+    if (contextUsr) {
+        rGrid.overrideEditWidgets.pickup_lib = new dijit.form.TextBox({"disabled": true});
+        rGrid.overrideEditWidgets.pickup_lib.shove = { create : contextUsrObj.home_ou() };
+        rGrid.showCreateDialog();
+    }
+}
+
 openils.Util.addOnLoad(setup);
 
 

commit bab0eb7e00016f6a05db8251c2f75b00f0e8c235
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue Jul 26 09:11:07 2011 -0400

    context filters for acq user requests UI
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/acq/picklist/user_request.tt2 b/Open-ILS/src/templates/acq/picklist/user_request.tt2
index 648a791..9d04a16 100644
--- a/Open-ILS/src/templates/acq/picklist/user_request.tt2
+++ b/Open-ILS/src/templates/acq/picklist/user_request.tt2
@@ -8,20 +8,43 @@
             <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
                 <div>[% ctx.page_title %]</div>
             </div>
-            <div>
-                <span>Context Org Unit</span>
-                <select 
-                    dojoType="openils.widget.OrgUnitFilteringSelect" 
-                    jsId='contextOrgSelector'
-                    searchAttr='shortname' 
-                    labelAttr='shortname'> 
-                </select>
+            <div style="width: 100%">
+                <span>
+                    <span>Context Org Unit</span>
+                    <select 
+                        dojoType="openils.widget.OrgUnitFilteringSelect" 
+                        jsId='contextOrgSelector'
+                        searchAttr='shortname' 
+                        labelAttr='shortname'> 
+                    </select>
+                </span>
+                <span>
+                    <a name="user" href="javascript:changeUserPrompt();">User</a>
+                    <span
+                        name="user"
+                        jsId="contextUsrTextbox"
+                        dojoType="dijit.form.TextBox"
+                        disabled="true">
+                    </span>
+                </span>
+                <span>
+                    <a name="lineitem" href="javascript:changeLIPrompt();">PO Line Item</a>
+                    <span
+                        name="lineitem"
+                        jsId="contextLITextbox"
+                        dojoType="dijit.form.TextBox"
+                        disabled="true">
+                    </span>
+                </span>
+                <button dojoType="dijit.form.Button" onClick="createRequest()">Create Request</button>
             </div>
             <table  jsId="rGrid"
                     dojoType="openils.widget.AutoGrid"
                     query="{id: '*'}"
                     suppressFields='["id", "usr", "pickup_lib", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
                     fieldOrder='["title", "author", "isxn", "article_title", "article_pages", "request_type", "volume", "pubdate", "publisher", "location", "other_info", "mentioned"]'
+                    editOnEnter='true'
+                    suppressEditFields='["id"]'
                     fmClass='aur'
                     editStyle='pane'
                     autoHeight='true'
diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
index 395f79e..d2b69f4 100644
--- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
+++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
@@ -32,6 +32,8 @@
     "LI_CANCEL_CONFIRM" : "Are you SURE you want to cancel this line item?",
     "LID_CANCEL_CONFIRM" : "Are you SURE you want to cancel this copy?",
     "UR_CANCEL_CONFIRM" : "Are you SURE you want to cancel this user request?",
+    "UR_FILTER_USER" : "Enter barcode for user (or leave blank to unset the filter):",
+    "UR_FILTER_LINEITEM" : "Enter id for lineitem (or leave blank to unset the filter):",
     "CANCEL_REASON" : "Cancel reason",
     "CANCEL" : "Cancel",
     "YES" : "Yes",
diff --git a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
index d3f4f63..0e67777 100644
--- a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
+++ b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
@@ -1,3 +1,4 @@
+dojo.require('openils.CGI');
 dojo.require('openils.Util');
 dojo.require('openils.User');
 dojo.require('openils.widget.AutoGrid');
@@ -7,12 +8,43 @@ dojo.require('openils.widget.EditPane');
 dojo.require("dijit.layout.StackContainer");
 dojo.require('openils.PermaCrud');
 dojo.requireLocalization("openils.acq", "acq");
+dojo.require('openils.acq.Lineitem');
 
 var contextOrg;
+var contextUsr;
+var contextLI;
+var contextEg_bib;
 var aur_obj;
 var localeStrings = dojo.i18n.getLocalization('openils.acq', 'acq');
+var cgi = new openils.CGI();
 
 function setup() {
+
+    if (cgi.param('eg_bib')) {
+        changeBib(cgi.param('eg_bib'));
+    }
+
+    if (cgi.param('lineitem')) {
+        changeLI(cgi.param('lineitem'));
+    }
+
+    if (cgi.param('usr')) {
+        var usr_obj = fieldmapper.standardRequest(
+            [
+                'open-ils.actor',
+                'open-ils.actor.user.fleshed.retrieve.authoritative'
+            ],
+            {
+                params: [openils.User.authtoken, cgi.param('usr')]
+            }
+        );
+        if (typeof usr_obj.textcode == 'undefined') {
+            changeUser(usr_obj.id(),usr_obj.card().barcode());
+        } else {
+            alert(usr_obj.textcode + ' : ' + usr_obj.desc);
+        }
+    }
+
     if(reqId) {
         drawRequest();
     } else {
@@ -27,6 +59,15 @@ function drawRequest() {
     // hide the grid and the context selector
     dijit.byId('stackContainer').forward();
 
+    // purge any previous lineitem display
+    // FIXME: I thought it would be cool to have this, but I can't get it 
+    // to look right with our dojo div/contentPanes.  So just testing for
+    // a DOM hook for now.
+    if (dojo.byId('lineitem')) {
+        //openils.Util.hide( 'lineitem_container' );
+        dojo.byId('lineitem').innerHTML = '';
+    }
+
     // toggle the View Picklist/Add to Picklist button label
     if (aur_obj.lineitem()) {
         openils.Util.hide( 'add_to_picklist' );
@@ -47,6 +88,16 @@ function drawRequest() {
     pane.hideActionButtons = true;
     pane.startup();
 
+    // lineitem summary
+    if (dojo.byId('lineitem') && aur_obj.lineitem()) {
+        //openils.Util.show( 'lineitem_container' );
+        openils.acq.Lineitem.fetchAndRender(aur_obj.lineitem(), {},
+            function(li, html) {
+                dojo.byId('lineitem').innerHTML = html;
+            }
+        );
+    }
+
     // including ability to add request to a picklist
     // and to "reject" it (aka apply a cancel reason)
 
@@ -162,18 +213,106 @@ function buildGrid() {
     if(contextOrg == null)
         contextOrg = openils.User.user.ws_ou();
 
+    var query = {
+        cancel_reason : null,
+        '+au' : {
+            home_ou : fieldmapper.aou.descendantNodeList(contextOrg).map(
+            function(item) { return item.id(); })
+        }
+    };
+
+    if (contextUsr) {
+        delete query['+au']['home_ou'];
+        query['+au']['id'] = contextUsr;
+    }
+
+    if (contextEg_bib) {
+        query['eg_bib'] = contextEg_bib;
+    }
+
+    if (contextLI) {
+        query['lineitem'] = contextLI;
+    }
+
+    rGrid.resetStore();
     rGrid.loadAll(
         {   order_by : {aur : 'request_date'},
             join : 'au' 
         },
-        {
-            cancel_reason : null,
-            '+au' : {
-                home_ou : fieldmapper.aou.descendantNodeList(contextOrg).map(
-                    function(item) { return item.id(); })
+        query
+    );
+}
+
+function changeBib(value) {
+    contextEg_bib = value;
+    rGrid.overrideEditWidgets.eg_bib = new dijit.form.TextBox({"disabled": true});
+    rGrid.overrideEditWidgets.eg_bib.shove = { create : contextEg_bib };
+}
+
+function changeLI(value,display_value) {
+    contextLI = value;
+    contextLITextbox.setValue( contextLI );
+    contextLITextbox.setDisplayedValue( display_value || contextLI );
+    rGrid.overrideEditWidgets.lineitem = new dijit.form.TextBox({"disabled": true});
+    rGrid.overrideEditWidgets.lineitem.shove = { create : contextLI };
+}
+
+function changeLIPrompt() {
+    var lineitem = window.prompt(localeStrings.UR_FILTER_LINEITEM);
+    if(lineitem != '' && (lineitem == null || Number(lineitem) == NaN)) {
+        return;
+    }
+    changeLI(lineitem);
+    buildGrid();
+}
+
+function changeUser(value,display_value) {
+    contextUsr = value;
+    contextUsrTextbox.setValue( contextUsr );
+    contextUsrTextbox.setDisplayedValue( display_value || contextUsr );
+    rGrid.overrideEditWidgets.usr = new dijit.form.TextBox({"disabled": true});
+    rGrid.overrideEditWidgets.usr.shove = { create : contextUsr };
+}
+
+function changeUserPrompt() {
+    var barcode = window.prompt(localeStrings.UR_FILTER_USER);
+    if(barcode == null) {
+        return;
+    }
+    if(typeof xulG != 'undefined' && xulG.get_barcode) {
+        // We have a "complete the barcode" function, call it (actor = users only)
+        var new_barcode = xulG.get_barcode(window, 'actor', barcode);
+        // If we got a result (boolean false is "no result") check it
+        if(new_barcode) {
+            // user_false string means they picked "None of the above"
+            // Abort before any other events can fire
+            if(new_barcode == "user_false") return;
+            // No error means we have a (hopefully valid) completed barcode to use.
+            // Otherwise, fall through to other methods of checking
+            if(typeof new_barcode.ilsevent == 'undefined')
+                barcode = new_barcode.barcode;
+        }
+    }
+    if (barcode == '') {
+        changeUser('','');
+    } else {
+        var usr_obj = fieldmapper.standardRequest(
+            [
+                'open-ils.actor',
+                'open-ils.actor.user.fleshed.retrieve_by_barcode.authoritative'
+            ],
+            {
+                params: [openils.User.authtoken, barcode]
             }
+        );
+        if (typeof usr_obj.textcode != 'undefined') {
+            alert(usr_obj.textcode + ' : ' + usr_obj.desc);
+            return;
+        } else {
+            changeUser(usr_obj.id(),usr_obj.card().barcode());
         }
-    );
+    }
+    buildGrid();
 }
 
 openils.Util.addOnLoad(setup);

commit f24c07b0c98d3647b144f8a93674b2ee0ecb10ce
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue Jul 26 08:31:32 2011 -0400

    copy/paste-o's, remove (near) duplicate code
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/acq/picklist/user_request.tt2 b/Open-ILS/src/templates/acq/picklist/user_request.tt2
index 3622a60..648a791 100644
--- a/Open-ILS/src/templates/acq/picklist/user_request.tt2
+++ b/Open-ILS/src/templates/acq/picklist/user_request.tt2
@@ -26,7 +26,6 @@
                     editStyle='pane'
                     autoHeight='true'
                     defaultCellWidth='"auto"'
-                    suppressFields="['id']"
                     showPaginator='true'
                     showColumnPicker='true'
                     columnPickerPrefix='"acq.picklist.user_request"'>
diff --git a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
index cf75f52..d3f4f63 100644
--- a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
+++ b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
@@ -98,24 +98,6 @@ function viewPicklist() {
     location.href = oilsBasePath + "/acq/picklist/view/" + lineitem.picklist();
 }
 
-function fooPicklist() {
-    if (aur_obj.lineitem()) {
-        viewPicklist();
-    } else {
-        addToPicklist();
-    }
-}
-
-function viewPicklist() {
-    var lineitem = fieldmapper.standardRequest(
-        [ 'open-ils.acq', 'open-ils.acq.lineitem.retrieve' ],
-        {
-            params: [openils.User.authtoken, aur_obj.lineitem()]
-        }
-    );
-    location.href = oilsBasePath + "/acq/picklist/view/" + lineitem.picklist();
-}
-
 function addToPicklist() {
     // reqId, from detail view
     location.href = oilsBasePath + "/acq/picklist/brief_record?ur=" + reqId + "&prepop=" + encodeURIComponent(js2JSON({

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |    2 +-
 Open-ILS/src/templates/acq/common/li_table.tt2     |    1 +
 .../src/templates/acq/picklist/user_request.tt2    |   40 ++++-
 Open-ILS/web/js/dojo/openils/acq/nls/acq.js        |    2 +
 Open-ILS/web/js/ui/default/acq/common/li_table.js  |    3 +
 .../web/js/ui/default/acq/picklist/user_request.js |  179 +++++++++++++++++---
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    2 +
 .../staff_client/chrome/content/main/constants.js  |    1 +
 Open-ILS/xul/staff_client/server/patron/display.js |   13 ++
 .../xul/staff_client/server/patron/display.xul     |    1 +
 .../server/patron/display_horiz_overlay.xul        |    1 +
 .../staff_client/server/patron/display_overlay.xul |    1 +
 12 files changed, 212 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list