[open-ils-commits] r9683 - in branches/acq-experiment/Open-ILS/web:
js/dojo/openils/acq
oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist
oilsweb/oilsweb/templates/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 22 22:18:08 EDT 2008
Author: erickson
Date: 2008-05-22 22:18:07 -0400 (Thu, 22 May 2008)
New Revision: 9683
Modified:
branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Picklist.js
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:
added search result to named picklist action
Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Picklist.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Picklist.js 2008-05-23 00:27:22 UTC (rev 9682)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Picklist.js 2008-05-23 02:18:07 UTC (rev 9683)
@@ -114,6 +114,20 @@
);
}
+/** Creates a new picklist. fields.name is required */
+openils.acq.Picklist.update = function(picklist, oncomplete) {
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.picklist.update'],
+ { async: true,
+ params: [openils.User.authtoken, picklist],
+ oncomplete: function(r) {
+ // XXX event/error handling
+ oncomplete(r.recv().content());
+ }
+ }
+ );
+}
+
/** Deletes a list of picklists
* @param list Array of picklist IDs
*/
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-23 00:27:22 UTC (rev 9682)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/picklist/bib_search.js 2008-05-23 02:18:07 UTC (rev 9683)
@@ -110,9 +110,17 @@
dojo.style('oils-acq-lineitem-details-grid', 'visibility', 'hidden');
}
);
+ resultPicklist = plist._plist;
}
-function saveAllAsPl() {
+function saveResults(values) {
+ if(!values.name) return;
+ resultPicklist.name(values.name);
+ openils.acq.Picklist.update(resultPicklist,
+ function(stat) {
+ location.href = 'view/' + resultPicklist.id();
+ }
+ );
}
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-23 00:27:22 UTC (rev 9682)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/bib_search.html 2008-05-23 02:18:07 UTC (rev 9683)
@@ -60,23 +60,26 @@
<div id='oils-acq-pl-search-results' style='height:100%'>
<script>
dojo.require('dijit.form.FilteringSelect');
+ dojo.require('dijit.Dialog');
</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 dojoType="dijit.form.DropDownButton">
+ <span>${('Save Results')}</span>
+ <div dojoType="dijit.TooltipDialog" execute="saveResults(arguments[0]);">
+ <script type='dojo/connect' event='onOpen'>
+ </script>
+ <table class='dijitTooltipTable'>
+ <tr>
+ <td><label for="name">${_('Save as picklist:')} </label></td>
+ <td><input dojoType="dijit.form.TextBox" name="name"></td>
+ </tr>
+ <tr>
+ <td colspan='2' align='center'>
+ <button dojoType=dijit.form.Button type="submit">${_('Save')}</button>
+ </td>
+ </tr>
+ </table>
</div>
- </div>
+ </div>
${jubgrid.jubgrid('oils-acq-lineitem', 'plResultGrid')}
</div>
<script>dojo.style('oils-acq-pl-search-results', 'visibility', 'hidden');</script>
More information about the open-ils-commits
mailing list