Acq: bugfixes, improvements to lineitem + bib search
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 7 May 2010 15:27:22 +0000 (15:27 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 7 May 2010 15:27:22 +0000 (15:27 +0000)
identify bib-results with a book icon to distinguish them from li
results; git rid of an alert() when canceling from a file upload dialog;
fix a sneaky bug that removed other match-type options once the user selecte
the "term from a file" option

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

Open-ILS/web/css/skin/default/acq.css
Open-ILS/web/js/dojo/openils/widget/XULTermLoader.js
Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/js/ui/default/acq/search/unified.js
Open-ILS/web/templates/default/acq/common/li_table.tt2

index 01c5c57..74d7e16 100644 (file)
@@ -231,6 +231,7 @@ option[disabled="disabled"] { font-style: italic; }
 .acq-unified-terms-remove { width: 5%; text-align: right; }
 .acq-unified-remover { color: #c00; }
 .acq-unified-result-specific-controls { margin-bottom: 8px; }
+span[name="bib_origin"] img { vertical-align: middle; }
 
 #acq-eligible-li-table { margin: 10px 0; }
 #acq-eligible-li-table th { background-color: #ccc; border: 1px #333 inset; font-weight: bold; padding: 6px; }
index fb4770d..50f2d27 100644 (file)
@@ -84,7 +84,8 @@ if (!dojo._hasResource["openils.widget.XULTermLoader"]) {
                 }
             },
             "parseUnimaginatively": function(data) {
-                return data.split(/[\n, ]/).filter(
+                if (!data) return [];
+                else return data.split(/[\n, ]/).filter(
                     function(o) { return o.length > 0; }
                 );
             }
index aefc837..19a8754 100644 (file)
@@ -298,14 +298,17 @@ function AcqLiTable() {
         }
 
         // show which picklist this lineitem is a member of
-        if(li.picklist() && (this.isPO || this.isMeta)) {
+        if(li.picklist() && (this.isPO || this.isMeta || this.isUni)) {
             var pl = 
                 this.plCache[li.picklist()] = 
                 this.plCache[li.picklist()] || 
                 fieldmapper.standardRequest(
                     ['open-ils.acq', 'open-ils.acq.picklist.retrieve'],
                     {params: [this.authtoken, li.picklist()]});
-            if(pl) {
+            if (pl) {
+                if (pl.name() == "")
+                    openils.Util.show(nodeByName("bib_origin", row), "inline");
+
                 openils.Util.show(nodeByName('pl', row), 'inline');
                 var link = nodeByName('pl_link', row);
                 link.setAttribute('href', oilsBasePath + '/acq/picklist/view/' + li.picklist());
index 0518559..c65834c 100644 (file)
@@ -288,7 +288,7 @@ function TermManager() {
             can_do_in = false; /* XXX might revise later */
         } else if (typeof(w.declaredClass) != "undefined") {
             can_do_fuzzy = can_do_in =
-                Boolean(w.declaredClass.match(/form\.Text/));
+                Boolean(w.declaredClass.match(/form\.Text|XULT/));
         } else {
             var type = dojo.attr(w, "type");
             if (type)
@@ -362,7 +362,7 @@ function TermManager() {
             this.allRowIds().forEach(
                 function(id) {
                     var term = self._selector(id).getTerm();
-                    if (!term ||
+                    if (term &&
                         !self.terms[term.hint][term.field].bib_friendly) {
                         self.removeRow(id);
                     }
@@ -568,6 +568,8 @@ function ResultManager(liTable, poGrid, plGrid, invGrid) {
     var self = this;
 
     this.liTable = liTable;
+    this.liTable.isUni = true;
+
     this.poGrid = poGrid;
     this.plGrid = plGrid;
     this.invGrid = invGrid;
index 955eaaa..36039a4 100644 (file)
@@ -79,7 +79,9 @@
                                 <tr>
                                     <td rowspan='2' style='width:43px;'><img style='width:40px;height:65px;' name='jacket'></img></td>
                                     <td style='width:70%;font-weight:bold;'>
-                                        <a attr='title' href='javascript:void(0);'></a>
+                                        <span name="bib_origin" class="hidden">
+                                            <img src="/opac/images/book-icon.png" />
+                                        </span><a attr='title' href='javascript:void(0);'></a>
                                         <span name="worksheet">(<a name="worksheet_link" href="javascript:void(0);">&#x270D;</a>)</span>
                                         <span name='pl' class='hidden'>(<a name='pl_link' href='javascript:void(0);'></a>)</span>
                                         <span name='po' class='hidden'>(<a name='po_link' href='javascript:void(0);'>PO</a>)</span>