var attrDefs = {};
var paramPL = null;
var paramPO = null;
+var paramUR = null; // User Request ID
function drawBriefRecordForm(fields) {
var cgi = new openils.CGI();
paramPL = cgi.param('pl');
paramPO = cgi.param('po');
+ paramUR = cgi.param('ur');
prepop = JSON2js(cgi.param('prepop'));
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;
dojo.require('openils.PermaCrud');
var contextOrg;
+var aur_obj;
function setup() {
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();
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() {
<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>
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'/>
</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>