[open-ils-commits] r16445 - in trunk/Open-ILS: examples web/js/dojo/openils/widget web/js/ui/default/acq/po web/templates/default/acq/po (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 17 16:50:58 EDT 2010


Author: erickson
Date: 2010-05-17 16:50:52 -0400 (Mon, 17 May 2010)
New Revision: 16445

Added:
   trunk/Open-ILS/web/templates/default/acq/po/edi_messages.tt2
Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
   trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
   trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
   trunk/Open-ILS/web/templates/default/acq/po/view.tt2
Log:
added selector column for edi_account; added edi messages page for POs; allow editpane cancel button to show when in readOnly mode

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2010-05-17 19:57:04 UTC (rev 16444)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2010-05-17 20:50:52 UTC (rev 16445)
@@ -5801,7 +5801,7 @@
 
 	<class id="acqedi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_account" oils_persist:tablename="acq.edi_account" reporter:label="EDI Account">
 		<fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
-			<field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID"/>
+			<field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
 			<field name="label"         reporter:datatype="text"      reporter:label="Label"/>
 			<field name="host"          reporter:datatype="text"      reporter:label="Host"/>
 			<field name="username"      reporter:datatype="text"      reporter:label="Username"/>

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2010-05-17 19:57:04 UTC (rev 16444)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2010-05-17 20:50:52 UTC (rev 16445)
@@ -377,7 +377,8 @@
 
                 var pane = new openils.widget.EditPane({
                     fmObject:fmObject,
-                    hideActionButtons : this.editReadOnly,
+                    hideSaveButton : this.editReadOnly,
+                    readOnly : this.editReadOnly,
                     overrideWidgets : this.overrideEditWidgets,
                     overrideWidgetClass : this.overrideEditWidgetClass,
                     overrideWidgetArgs : this.overrideWidgetArgs,

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js	2010-05-17 19:57:04 UTC (rev 16444)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js	2010-05-17 20:50:52 UTC (rev 16445)
@@ -36,7 +36,7 @@
                 this.inherited(arguments);
                 this.initAutoEnv();
                 if(this.readOnly)
-                    this.hideActionButtons = true;
+                    this.hideSaveButton = true;
 
                 // grab any field-level docs
                 /*
@@ -174,6 +174,8 @@
                     onClick : this.onCancel
                 }, cancelSpan);
 
+                if(this.hideSaveButton) return;
+
                 new dijit.form.Button({
                     label:'Save',  // XXX
                     onClick: function() {self.performAutoEditAction();}

Modified: trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js	2010-05-17 19:57:04 UTC (rev 16444)
+++ trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js	2010-05-17 20:50:52 UTC (rev 16445)
@@ -390,6 +390,25 @@
             }
         }
     );
+
+    pcrud.search(
+        'acqedim', 
+        {purchase_order : poId}, 
+        {
+            order_by : {acqedim : 'create_time'},
+            oncomplete : function(r) {
+                var resp = openils.Util.readResponse(r);
+                // TODO: I18n
+                if(resp) {
+                    dojo.byId('acq-po-view-edi-messages').innerHTML = '(' + resp.length + ')';
+                    dojo.byId('acq-po-view-edi-messages').setAttribute('href', oilsBasePath + '/acq/po/edi_messages/' + poId);
+                } else {
+                    dojo.byId('acq-po-view-edi-messages').innerHTML = '0';
+                    dojo.byId('acq-po-view-edi-messages').setAttribute('href', '');
+                }
+            }
+        }
+    );
 }
 
 function checkCouldActivatePo() {

Added: trunk/Open-ILS/web/templates/default/acq/po/edi_messages.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/po/edi_messages.tt2	                        (rev 0)
+++ trunk/Open-ILS/web/templates/default/acq/po/edi_messages.tt2	2010-05-17 20:50:52 UTC (rev 16445)
@@ -0,0 +1,32 @@
+[% WRAPPER "default/base.tt2" %]
+[% ctx.page_title = "PO History" %]
+<script type="text/javascript">
+    dojo.require('openils.Util');
+    dojo.require('openils.widget.AutoGrid');
+    dojo.require('openils.widget.Textarea');
+
+    var poId = "[% ctx.page_args.0 %]";
+    openils.Util.addOnLoad(
+        function() {
+            edimGrid.loadAll({order_by : {acqedim :  'create_time DESC'}}, {purchase_order : poId});
+        }
+    );
+</script>
+<h1>Purchase Order EDI</h1>
+<br/>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <table  jsId="edimGrid"
+            autoHeight='true'
+            dojoType="openils.widget.AutoGrid"
+            defaultCellWidth="'auto'"
+            fieldOrder="['message_type', 'status', 'create_time', 'translate_time', 'process_time', 'error_time', 'remote_file', 'error']"
+            query="{id: '*'}"
+            suppressFields="['id', 'edi', 'jedi', 'purchase_order']"
+            editStyle='pane'
+            fmClass='acqedim'
+            editOnEnter='true'
+            editReadOnly='true'
+            showPaginator='true'>
+    </table>
+</div>
+[% END %]

Modified: trunk/Open-ILS/web/templates/default/acq/po/view.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/po/view.tt2	2010-05-17 19:57:04 UTC (rev 16444)
+++ trunk/Open-ILS/web/templates/default/acq/po/view.tt2	2010-05-17 20:50:52 UTC (rev 16445)
@@ -45,6 +45,13 @@
                             id="acq-po-view-notes"></a>
                     </td>
                 </tr>
+                <tr>
+                    <td>EDI Messages</td>
+                    <td>
+                        <a href="javascript:void(0);"
+                            id="acq-po-view-edi-messages"></a>
+                    </td>
+                </tr>
                 <tr id="acq-po-activate" class="hidden">
                     <td>Activatable?</td>
                     <td>



More information about the open-ils-commits mailing list