From f6823e0e75773a7dd84e81875bdf0c52527a196f Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 27 Mar 2009 20:00:33 +0000 Subject: [PATCH] adding some initial readonly parts git-svn-id: svn://svn.open-ils.org/ILS/trunk@12707 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/common/li_table.js | 15 ++++++++++----- Open-ILS/web/templates/default/acq/common/li_table.tt2 | 3 ++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 232138a3a..21c236f43 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -154,9 +154,9 @@ function AcqLiTable() { this._fetchLineitem = function(liId, handler) { - if(this.liCache[liId] && this.liCache[liId].marc()) { - return handler(this.liCache[liId]); - } + var li = this.liCache[liId]; + if(li && li.marc() && li.lineitem_details()) + return handler(li); fieldmapper.standardRequest( ['open-ils.acq', 'open-ils.acq.lineitem.retrieve'], @@ -338,6 +338,7 @@ function AcqLiTable() { fmClass : 'acqlid', parentNode : dojo.query('[name='+field+']', row)[0], orgLimitPerms : ['CREATE_PICKLIST'], + readOnly : self.isPO }); widget.build(); dojo.connect(widget.widget, 'onChange', @@ -353,8 +354,12 @@ function AcqLiTable() { } ); - dojo.query('[name=delete]', row)[0].onclick = - function() { self.deleteCopy(row) }; + if(this.isPO) { + openils.Util.hide(dojo.query('[name=delete]', row)[0].parentNode); + } else { + dojo.query('[name=delete]', row)[0].onclick = + function() { self.deleteCopy(row) }; + } }; this.deleteCopy = function(row) { diff --git a/Open-ILS/web/templates/default/acq/common/li_table.tt2 b/Open-ILS/web/templates/default/acq/common/li_table.tt2 index 8a162c5e5..25fcb6da5 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -3,7 +3,7 @@