Acq: fixing misc UI glitches
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Jun 2010 16:00:36 +0000 (16:00 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Jun 2010 16:00:36 +0000 (16:00 +0000)
Creating allocations and credits in the Funding Source Details interface
didn't populate the appropriate grid immediately, but now it does.

New tags didn't seem to persist in the Fund Details interface if you switched
tabs and then came back to the Tags tab.  Fixed.

Changed some tab names of misc Acq interfaces to match their current names in
the staff client menu.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16815 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/common/tag_manager.js
Open-ILS/web/js/ui/default/acq/financial/view_fund.js
Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js
Open-ILS/web/templates/default/acq/financial/view_funding_source.tt2
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties

index c2086aa..6a49421 100644 (file)
@@ -57,6 +57,11 @@ function TagManager(displayNode) {
                         dojo.destroy(
                             "oils-acq-fund-tag-mapping-" + mapping.id()
                         );
+                        fund.tags(
+                            fund.tags().filter(
+                                function(o) { return o.id() != mapping.id(); }
+                            )
+                        );
                     },
                     "onerror": function() {
                         /* XXX does onerror not actually work? */
@@ -81,6 +86,7 @@ function TagManager(displayNode) {
                 "oncomplete": function(r, list) {
                     mapping = list[0]; /* get the new mapping's ID this way */
                     mapping.tag(tag); /* re-"flesh" */
+                    fund.tags().push(mapping); /* save local reference */
                     dojo.place(
                         self.renderTagMapping(mapping),
                         self.displayNode, "last"
index 8a30a6c..8eb04b0 100644 (file)
@@ -66,6 +66,9 @@ function loadFundGrid() {
 
 function loadAllocationGrid() {
     if(fundAllocationGrid.isLoaded) return;
+    /* XXX If we want to show allocating user with a username instead of just
+     * ID#, the following pcrud search will have to be replaced with an API
+     * call. */
     fundAllocationGrid.loadAll({order_by : {acqfa :  'create_time DESC'}});
     fundAllocationGrid.isLoaded = true;
 }
index 070423a..5a68df1 100644 (file)
@@ -16,11 +16,11 @@ dojo.require('openils.widget.AutoGrid');
 var ses = new OpenSRF.ClientSession('open-ils.acq');
 var fundingSource = null;
 
-function resetPage() {
+function resetPage(also_load_grid) {
     fundingSource = null;
     fsCreditGrid.isLoaded = false;
     fsAllocationGrid.isLoaded = false;
-    loadFS();
+    loadFS(also_load_grid);
 }
 
 function getFund(rowIndex, item) {
@@ -32,17 +32,21 @@ function getFund(rowIndex, item) {
 /** creates a new funding_source_credit from the dialog ----- */
 function applyFSCredit(fields) {
     fields.funding_source = fundingSourceID;
-    openils.acq.FundingSource.createCredit(fields, resetPage);
+    openils.acq.FundingSource.createCredit(
+        fields, function() { resetPage(loadCreditGrid); }
+    );
 }
 
 function applyFSAllocation(fields) {
     fields.funding_source = fundingSourceID;
     if(isNaN(fields.amount)) fields.amount = null;
-    openils.acq.Fund.createAllocation(fields, resetPage);
+    openils.acq.Fund.createAllocation(
+        fields, function() { resetPage(loadAllocationGrid); }
+    );
 }
 
 /** fetch the fleshed funding source ----- */
-function loadFS() {
+function loadFS(also_load_grid) {
     var req = ses.request(
         'open-ils.acq.funding_source.retrieve', 
         openils.User.authtoken, fundingSourceID, 
@@ -58,6 +62,8 @@ function loadFS() {
             return;
         }
         loadFSGrid();
+        if (typeof(also_load_grid) == "function")
+            also_load_grid(true /* reset_first */);
     }
     req.send();
 }
@@ -87,7 +93,7 @@ function formatFund(fund) {
     }
 }
 
-/** builds the credits grid ----- */
+/** builds the summary grid ----- */
 function loadFSGrid() {
     if(!fundingSource) return;
     var store = new dojo.data.ItemFileReadStore({data:acqfs.toStoreData([fundingSource])});
@@ -97,8 +103,9 @@ function loadFSGrid() {
 
 
 /** builds the credits grid ----- */
-function loadCreditGrid() {
-    if(fsCreditGrid.isLoaded) return;
+function loadCreditGrid(reset_first) {
+    if (fsCreditGrid.isLoaded) return;
+    if (reset_first) fsCreditGrid.resetStore();
     fsCreditGrid.loadAll(
         {"order_by": {"acqfscred": "effective_date DESC"}},
         {"funding_source": fundingSource.id()}
@@ -106,8 +113,9 @@ function loadCreditGrid() {
     fsCreditGrid.isLoaded = true;
 }
 
-function loadAllocationGrid() {
-    if(fsAllocationGrid.isLoaded) return;
+function loadAllocationGrid(reset_first) {
+    if (fsAllocationGrid.isLoaded) return;
+    if (reset_first) fsCreditGrid.resetStore();
     fsAllocationGrid.loadAll(
         {"order_by": {"acqfa": "create_time DESC"}},
         {"funding_source": fundingSource.id()}
index 1e9511d..0c7d385 100644 (file)
 
                     <table 
                         jsId="fsCreditGrid"
+                        autoheight="true"
                         dojoType="openils.widget.AutoGrid"
                         fieldOrder="['amount', 'effective_date', 'deadline_date', 'note']"
                         suppressFields="['id', 'funding_source']"
index 5435982..19a60f0 100644 (file)
@@ -225,14 +225,14 @@ menu.cmd_local_admin_reports.tab=Reports
 menu.cmd_local_admin_cash_reports.tab=Cash Reports
 menu.cmd_local_admin_transit_list.tab=Transits
 menu.cmd_acq_create_invoice.tab=New Invoice
-menu.cmd_acq_bib_search.tab=Title Search
-menu.cmd_acq_from_bib.tab=Import Catalog Records
+menu.cmd_acq_bib_search.tab=MARC Federated Search
+menu.cmd_acq_from_bib.tab=Load Catalog Record IDs
 menu.cmd_acq_unified_search.tab=Acquisitions Search
-menu.cmd_acq_upload.tab=Load Order Record
+menu.cmd_acq_upload.tab=Load MARC Order Records
 menu.cmd_acq_new_brief_record.tab=New Brief Record
 menu.cmd_acq_po.tab=Purchase Orders
-menu.cmd_acq_user_requests.tab=User Requests
-menu.cmd_acq_claim_eligible.tab=Claim-Eligible Items
+menu.cmd_acq_user_requests.tab=Patron Requests
+menu.cmd_acq_claim_eligible.tab=Claim-Ready Items
 menu.cmd_booking_resource.tab=Resources
 menu.cmd_booking_reservation.tab=Reservations
 menu.cmd_booking_reservation_pickup.tab=Reservation Pickup