[open-ils-commits] r15947 - in trunk/Open-ILS/web: js/ui/default/acq/picklist templates/default/acq/picklist (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Mar 24 12:08:20 EDT 2010
Author: phasefx
Date: 2010-03-24 12:08:17 -0400 (Wed, 24 Mar 2010)
New Revision: 15947
Modified:
trunk/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
trunk/Open-ILS/web/templates/default/acq/picklist/user_request.tt2
Log:
for user requests, View Picklist instead of Add to Picklist where appropriate. TODO: change the cancel method wired up here
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/user_request.js 2010-03-24 15:41:40 UTC (rev 15946)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/user_request.js 2010-03-24 16:08:17 UTC (rev 15947)
@@ -28,6 +28,15 @@
// hide the grid and the context selector
dijit.byId('stackContainer').forward();
+ // toggle the View Picklist/Add to Picklist button label
+ if (aur_obj.lineitem()) {
+ openils.Util.addCSSClass( document.getElementById('add_to_picklist'), 'hidden' );
+ openils.Util.removeCSSClass( document.getElementById('view_picklist'), 'hidden' );
+ } else {
+ openils.Util.addCSSClass( document.getElementById('view_picklist'), 'hidden' );
+ openils.Util.removeCSSClass( document.getElementById('add_to_picklist'), 'hidden' );
+ }
+
// draw a detail page for a particular request
var div = document.getElementById('detail_content_pane');
while (div.lastChild) { div.removeChild( div.lastChild ); }
@@ -43,8 +52,26 @@
// and to "reject" it (aka apply a cancel reason)
}
+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
+ // reqId, from detail view
location.href = oilsBasePath + "/acq/picklist/brief_record?ur=" + reqId + "&prepop=" + encodeURIComponent(js2JSON({
"1": aur_obj.title() || aur_obj.article_title() || aur_obj.volume(),
"2": aur_obj.author(),
@@ -55,13 +82,29 @@
}
function setNoHold() {
- // reqId
- alert('stub');
+ // reqId, from detail view
+ fieldmapper.standardRequest(
+ [ 'open-ils.acq', 'open-ils.acq.user_request.set_no_hold.batch' ],
+ { async: true,
+ params: [openils.User.authtoken, [reqId]],
+ oncomplete: function(r) {
+ drawRequest();
+ }
+ }
+ );
}
function cancelRequest() {
- // reqId
- alert('stub');
+ // reqId, from detail view
+ fieldmapper.standardRequest(
+ [ 'open-ils.acq', 'open-ils.acq.user_request.cancel.batch' ],
+ { async: true,
+ params: [openils.User.authtoken, [reqId]],
+ oncomplete: function(r) {
+ drawRequest();
+ }
+ }
+ );
}
// format the title data as id:title
Modified: trunk/Open-ILS/web/templates/default/acq/picklist/user_request.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/picklist/user_request.tt2 2010-03-24 15:41:40 UTC (rev 15946)
+++ trunk/Open-ILS/web/templates/default/acq/picklist/user_request.tt2 2010-03-24 16:08:17 UTC (rev 15947)
@@ -48,7 +48,7 @@
<div>Patron Request</div>
<div>
<button dojoType="dijit.form.Button" onClick="location.href=oilsBasePath+'/acq/picklist/user_request'">[% ctx.page_title %]</button>
- <button dojoType="dijit.form.Button" onClick="addToPicklist()">Add to Picklist</button>
+ <button dojoType="dijit.form.Button" onClick="fooPicklist()"><span id="add_to_picklist">Add to Picklist</span><span id="view_picklist">View Picklist</span></button>
<button dojoType="dijit.form.Button" onClick="setNoHold()">Set No Hold</button>
<button dojoType="dijit.form.Button" onClick="cancelRequest()">Cancel Request with Reason</button>
</div>
More information about the open-ils-commits
mailing list