added selector column for edi_account; added edi messages page for POs; allow editpan...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 May 2010 20:50:52 +0000 (20:50 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 May 2010 20:50:52 +0000 (20:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16445 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Open-ILS/web/js/dojo/openils/widget/EditPane.js
Open-ILS/web/js/ui/default/acq/po/view_po.js
Open-ILS/web/templates/default/acq/po/edi_messages.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/acq/po/view.tt2

index 1267d84..bf93f13 100644 (file)
@@ -5801,7 +5801,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
        <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"/>
index 08384b6..0ff2d87 100644 (file)
@@ -377,7 +377,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
 
                 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,
index c499615..760eca8 100644 (file)
@@ -36,7 +36,7 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                 this.inherited(arguments);
                 this.initAutoEnv();
                 if(this.readOnly)
-                    this.hideActionButtons = true;
+                    this.hideSaveButton = true;
 
                 // grab any field-level docs
                 /*
@@ -174,6 +174,8 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                     onClick : this.onCancel
                 }, cancelSpan);
 
+                if(this.hideSaveButton) return;
+
                 new dijit.form.Button({
                     label:'Save',  // XXX
                     onClick: function() {self.performAutoEditAction();}
index cc3c2a7..6043bf0 100644 (file)
@@ -390,6 +390,25 @@ params: [openils.User.authtoken, {purchase_order:poId}, {flesh_attrs:true, flesh
             }
         }
     );
+
+    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() {
diff --git a/Open-ILS/web/templates/default/acq/po/edi_messages.tt2 b/Open-ILS/web/templates/default/acq/po/edi_messages.tt2
new file mode 100644 (file)
index 0000000..48c770b
--- /dev/null
@@ -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 %]
index 5e1c56d..f9fbb83 100644 (file)
                             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>