[open-ils-commits] r9681 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/picklist
templates/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 22 20:23:26 EDT 2008
Author: erickson
Date: 2008-05-22 20:23:25 -0400 (Thu, 22 May 2008)
New Revision: 9681
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html
Log:
For faster discovery, showing search results on search-form page instead
of redirecting to the picklist detail page.
need to wire up the actions
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js 2008-05-22 21:53:52 UTC (rev 9680)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js 2008-05-23 00:23:25 UTC (rev 9681)
@@ -3,7 +3,9 @@
dojo.require('dijit.ProgressBar');
dojo.require('dijit.form.Form');
dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.NumberSpinner');
dojo.require('openils.Event');
+dojo.require('openils.acq.Picklist');
var searchFields = [];
var resultPicklist;
@@ -45,7 +47,8 @@
var field = searchFields[f];
if(dijit.byId('text_input_'+field.name)) continue;
var row = tmpl.cloneNode(true);
- tbody.appendChild(row);
+ //tbody.appendChild(row);
+ tbody.insertBefore(row, dojo.byId('oils-acq-seach-fields-count-row'));
var labelCell = dojo.query('[name=label]', row)[0];
var inputCell = dojo.query('[name=input]', row)[0];
labelCell.appendChild(document.createTextNode(field.label));
@@ -56,15 +59,17 @@
function doSearch(values) {
dojo.style('searchProgress', 'visibility', 'visible');
+ searchProgress.update({progress: 0});
search = {
service : [],
username : [],
password : [],
search : {},
- limit : searchLimit,
+ limit : values.limit,
offset : searchOffset
- }
+ };
+ delete values.limit;
var selected = bibSourceSelect.getValue();
for(var i = 0; i < selected.length; i++) {
@@ -93,8 +98,21 @@
function handleResult(r) {
var result = r.recv().content();
if(result.complete)
- return viewPicklist(result.picklist_id);
+ return viewResults(result.picklist_id);
searchProgress.update({maximum: result.total, progress: result.progress});
}
+function viewResults(plId) {
+ var plist = new openils.acq.Picklist(plId,
+ function(model) {
+ dojo.style('oils-acq-pl-search-results', 'visibility', 'visible');
+ JUBGrid.populate(plResultGrid, model, plist._items);
+ dojo.style('oils-acq-lineitem-details-grid', 'visibility', 'hidden');
+ }
+ );
+}
+
+function saveAllAsPl() {
+}
+
dojo.addOnLoad(drawForm);
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-05-22 21:53:52 UTC (rev 9680)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-05-23 00:23:25 UTC (rev 9681)
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
<%inherit file='base.html'/>
+<%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
<%def name="page_title()">${_('Title Search')}</%def>
<%def name="block_content()">
@@ -10,11 +11,7 @@
</style>
<script>
- var searchLimit = ${c.oils.acq.limit.value} || 10;
var searchOffset = ${c.oils.acq.offset.value} || 0;
- function viewPicklist(id) {
- location.href = '${c.oils.acq.prefix.value}/picklist/view/' + id;
- }
</script>
<div id='oils-acq-search-block' class='container'>
@@ -29,6 +26,10 @@
multiple='true' jsId="bibSourceSelect" dojoType="dojox.form.CheckedMultiSelect">
<option value='native-evergreen-catalog'>${_('Evergreen Catalog')}</option>
</select>
+ <div id='oils-acq-search-progress'>
+ <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
+ </div>
+ <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
</div>
<div id='oils-acq-search-form-block'>
<div id='oils-acq-search-fields-label'>${_('Search Fields')}</div>
@@ -40,6 +41,14 @@
<td name='label'> </td>
<td name='input'> </td>
</tr>
+ <tr id='oils-acq-seach-fields-count-row'>
+ <td name='label'>Hits Per Source</td>
+ <td><input name='limit'
+ dojoType='dijit.form.NumberSpinner'
+ constraints='{min:5,max:50}'
+ value='10'></input>
+ </td>
+ </tr>
</tbody>
</table>
<div id='oils-acq-search-fields-submit-block'>
@@ -48,10 +57,29 @@
</div>
</div>
</form>
- <div id='oils-acq-search-progress'>
- <div dojoType="dijit.ProgressBar" style="width:300px" jsId="searchProgress" id="searchProgress"></div>
+ <div id='oils-acq-pl-search-results' style='height:100%'>
+ <script>
+ dojo.require('dijit.form.FilteringSelect');
+ </script>
+ <div dojoType="dijit.Toolbar" class='menuBar'>
+ <div dojoType="dijit.form.DropDownButton">
+ <span>Actions</span>
+ <div dojoType="dijit.Menu">
+ <div dojoType="dijit.MenuItem"
+ iconClass="dijitEditorIcon dijitEditorIconCopy"
+ onClick='saveAllAsPl();'>Save All as Picklist</div>
+ <div dojoType="dijit.MenuItem"
+ iconClass="dijitEditorIcon dijitEditorIconCopy">Save Selected as Picklist</div>
+ <div dojoType="dijit.MenuItem"
+ iconClass="dijitEditorIcon dijitEditorIconCopy">Add All to Picklist</div>
+ <div dojoType="dijit.MenuItem"
+ iconClass="dijitEditorIcon dijitEditorIconCopy">Add Selected to Picklist</div>
+ </div>
+ </div>
+ </div>
+ ${jubgrid.jubgrid('oils-acq-lineitem', 'plResultGrid')}
</div>
- <script>dojo.style('searchProgress', 'visibility', 'hidden');</script>
+ <script>dojo.style('oils-acq-pl-search-results', 'visibility', 'hidden');</script>
</%def>
More information about the open-ils-commits
mailing list