begining of brief record entry form, based on defined marc attr defs. just need...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 27 Apr 2009 21:32:11 +0000 (21:32 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 27 Apr 2009 21:32:11 +0000 (21:32 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13003 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/picklist/brief_record.js [new file with mode: 0644]
Open-ILS/web/templates/default/acq/picklist/brief_record.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/menu.tt2

diff --git a/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js b/Open-ILS/web/js/ui/default/acq/picklist/brief_record.js
new file mode 100644 (file)
index 0000000..8ccabe2
--- /dev/null
@@ -0,0 +1,51 @@
+dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('dijit.form.Form');
+dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.DateTextBox');
+dojo.require('dijit.form.Button');
+dojo.require('openils.User');
+dojo.require('openils.widget.AutoFieldWidget');
+dojo.require('openils.MarcXPathParser');
+
+function drawBriefRecordForm(fields) {
+
+    var tbody = dojo.byId('acq-brief-record-tbody');
+    var rowTmpl = dojo.byId('acq-brief-record-row');
+
+    fieldmapper.standardRequest(
+        ['open-ils.acq', 'open-ils.acq.lineitem_attr_definition.retrieve.all'],
+        {   async : true,
+            params : [openils.User.authtoken],
+
+            oncomplete : function(r) {
+                var attrs = openils.Util.readResponse(r);
+                if(attrs && attrs.marc) {
+
+                    attrs = attrs.marc.sort(
+                        function(a, b) {
+                            if(a.description < b.description)
+                                return 1;
+                            return -1;
+                        }
+                    );
+
+                    dojo.forEach(attrs,
+                        function(def) {
+                            var row = rowTmpl.cloneNode(true);
+                            dojo.query('[name=name]', row)[0].innerHTML = def.description();
+                            new dijit.form.TextBox({name : def.code()}, dojo.query('[name=widget]', row)[0]);
+                            tbody.appendChild(row);
+                        }
+                    );
+                }
+            }
+        }
+    );
+}
+
+function compileBriefRecord(fields) {
+    console.log(js2JSON(fields));
+    return false;
+}
+
+openils.Util.addOnLoad(drawBriefRecordForm);
diff --git a/Open-ILS/web/templates/default/acq/picklist/brief_record.tt2 b/Open-ILS/web/templates/default/acq/picklist/brief_record.tt2
new file mode 100644 (file)
index 0000000..73be278
--- /dev/null
@@ -0,0 +1,25 @@
+[% WRAPPER 'default/base.tt2' %]
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/brief_record.js'> </script>
+
+<h1>New Brief Record</h1><br/>
+<form dojoType='dijit.form.Form'>
+    <script type='dojo/method' event='onSubmit'>
+        return compileBriefRecord(this.getValues());
+    </script>
+    <table class='oils-generic-table'>
+        <tbody id='acq-brief-record-tbody'>
+            <tr id='acq-brief-record-row'>
+                <td><div name='name'/></td>
+                <td><div name='widget'/></td>
+            </tr>
+        </tbody>
+        <tbody>
+            <tr>
+                <td colspan='2' style='text-align:center;'>
+                    <button dojoType='dijit.form.Button' type='submit'>Submit</button>
+                </td>
+            </tr>
+        </tbody>
+    </table>
+</form>
+[% END %]
index 7dd70a8..588e152 100644 (file)
                             onClick="location.href = '[% ctx.base_uri %]/acq/picklist/upload';">
                             Load Records
                         </div>
+                        <div dojoType="dijit.MenuItem" iconClass="dijitEditorIcon dijitEditorIconCopy"
+                            onClick="location.href = '[% ctx.base_uri %]/acq/picklist/brief_record';">
+                            New Brief Record
+                        </div>
                     </div>
                 </div>