[open-ils-commits] r15932 - 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
Mon Mar 22 17:31:21 EDT 2010
Author: phasefx
Date: 2010-03-22 17:31:15 -0400 (Mon, 22 Mar 2010)
New Revision: 15932
Modified:
trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js
trunk/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
trunk/Open-ILS/web/templates/default/acq/picklist/user_request.tt2
Log:
Add to Picklist function for acq user requests. Disable EditOnEnter for list view.
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js 2010-03-22 20:13:36 UTC (rev 15931)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js 2010-03-22 21:31:15 UTC (rev 15932)
@@ -13,6 +13,7 @@
var attrDefs = {};
var paramPL = null;
var paramPO = null;
+var paramUR = null; // User Request ID
function drawBriefRecordForm(fields) {
@@ -21,6 +22,7 @@
var cgi = new openils.CGI();
paramPL = cgi.param('pl');
paramPO = cgi.param('po');
+ paramUR = cgi.param('ur');
prepop = JSON2js(cgi.param('prepop'));
@@ -213,6 +215,17 @@
if(!id) return;
if(editMarc) {
// XXX load marc editor
+ } else if (paramUR) {
+ // update User Request with Lineitem and reload request interface
+ var pcrud = new openils.PermaCrud({ authtoken : openils.User.authtoken });
+ var aur_obj = pcrud.retrieve('aur',paramUR);
+ aur_obj.lineitem( id );
+ pcrud.update( aur_obj, {
+ 'oncomplete' : function(r, cudResults) {
+ // Goes back to the list view
+ location.href = oilsBasePath + '/acq/picklist/user_request';
+ }
+ });
} else {
if(fields.picklist)
location.href = oilsBasePath + '/acq/picklist/view/' + fields.picklist;
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-22 20:13:36 UTC (rev 15931)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/user_request.js 2010-03-22 21:31:15 UTC (rev 15932)
@@ -8,6 +8,7 @@
dojo.require('openils.PermaCrud');
var contextOrg;
+var aur_obj;
function setup() {
@@ -22,7 +23,7 @@
function drawRequest() {
var pcrud = new openils.PermaCrud({ authtoken : openils.User.authtoken });
- var aur_obj = pcrud.retrieve('aur',reqId);
+ aur_obj = pcrud.retrieve('aur',reqId);
// hide the grid and the context selector
dijit.byId('stackContainer').forward();
@@ -44,7 +45,13 @@
function addToPicklist() {
// reqId
- alert('stub');
+ 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(),
+ "5": aur_obj.isxn(),
+ "9": aur_obj.publisher(),
+ "10": aur_obj.pubdate()
+ }));
}
function setNoHold() {
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-22 20:13:36 UTC (rev 15931)
+++ trunk/Open-ILS/web/templates/default/acq/picklist/user_request.tt2 2010-03-22 21:31:15 UTC (rev 15932)
@@ -4,6 +4,7 @@
<script>var reqId = '[% ctx.page_args.0 %]';</script>
<div dojoType="dijit.layout.StackContainer" id="stackContainer" doLayout="false">
+ <!-- *** List View ********************************************************************************* -->
<div dojoType="dijit.layout.ContentPane">
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>[% ctx.page_title %]</div>
@@ -33,8 +34,7 @@
suppressFields="['id']"
showPaginator='true'
showColumnPicker='true'
- columnPickerPrefix='"acq.picklist.user_request"'
- editOnEnter='true'>
+ columnPickerPrefix='"acq.picklist.user_request"'>
<thead>
<tr>
<th field='title' get='getTitle' formatter='formatTitle'/>
@@ -42,6 +42,7 @@
</thead>
</table>
</div>
+ <!-- *** Detail View ********************************************************************************* -->
<div dojoType="dijit.layout.ContentPane" style="height: 100%;">
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>Patron Request</div>
More information about the open-ils-commits
mailing list