initial lineitem marc attr def editor ui
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Feb 2010 22:43:55 +0000 (22:43 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Feb 2010 22:43:55 +0000 (22:43 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15592 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/conify/global/acq/lineitem_marc_attr_def.js [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/acq/lineitem_marc_attr_def.tt2 [new file with mode: 0644]

diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/lineitem_marc_attr_def.js b/Open-ILS/web/js/ui/default/conify/global/acq/lineitem_marc_attr_def.js
new file mode 100644 (file)
index 0000000..b91db71
--- /dev/null
@@ -0,0 +1,21 @@
+dojo.require('openils.widget.AutoGrid');
+dojo.require('openils.PermaCrud');
+dojo.require('openils.Util');
+dojo.require('openils.User');
+dojo.require('openils.MarcXPathParser');
+
+var xpathParser = new openils.MarcXPathParser();
+
+function init() {
+    attrGrid.loadAll({order_by : {acqlimad : 'code'}});
+}
+
+function attrGridGetTag(rowIdx, item) {
+    return item && xpathParser.parse(this.grid.store.getValue(item, 'xpath')).tags;
+}
+
+function attrGridGetSubfield(rowIdx, item) {
+    return item && xpathParser.parse(this.grid.store.getValue(item, 'xpath')).subfields;
+}
+
+openils.Util.addOnLoad(init);
diff --git a/Open-ILS/web/templates/default/conify/global/acq/lineitem_marc_attr_def.tt2 b/Open-ILS/web/templates/default/conify/global/acq/lineitem_marc_attr_def.tt2
new file mode 100644 (file)
index 0000000..5a32632
--- /dev/null
@@ -0,0 +1,32 @@
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/lineitem_marc_attr_def.js'> </script>
+
+<!-- grid -->
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+            <div>Line Item MARC Attribute Definition Editor</div>
+            <div>
+                <button dojoType='dijit.form.Button' onClick='attrGrid.showCreateDialog()'>New Attribute</button>
+                <button dojoType='dijit.form.Button' onClick='attrGrid.deleteSelected()'>Delete Selected</button>
+            </div>
+        </div>
+        <table  jsId="attrGrid"
+                dojoType="openils.widget.AutoGrid"
+                fieldOrder="['id', 'code', 'description', 'tag', 'subfield', 'ident', 'xpath', 'remove']"
+                query="{id: '*'}"
+                defaultCellWidth='"auto"'
+                fmClass='acqlimad'
+                editOnEnter='true'>
+            <thead>
+                <tr>
+                    <th field='tag' get='attrGridGetTag'>Tag</th>
+                    <th field='subfield' get='attrGridGetSubfield'>Subfield</th>
+                </tr>
+            </thead>
+        </table>
+    </div>
+</div>
+[% END %]
+
+