</permacrud>
</class>
- <class id="cza" controller="open-ils.cstore" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
+ <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
<fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
<field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id"/>
<field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
<links>
<link field="source" reltype="has_a" key="name" map="" class="czs"/>
</links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
+ <retrieve/>
+ <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
+ <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
+ </actions>
+ </permacrud>
</class>
<class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+[% source_code = ctx.page_args.0;
+ IF source_code %]
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>[% l('Z39.50 Attributes') %]</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='zaGrid.showCreateDialog()'>[% l('New') %]</button>
+ <button dojoType='dijit.form.Button' onClick='zaGrid.deleteSelected()'>[% l('Delete Selected') %]</button>
+ </div>
+ </div>
+
+ <table
+ id="zaGrid"
+ jsid="zaGrid"
+ dojoType="openils.widget.FlattenerGrid"
+ columnPersistKey='"conify.config.z3950_attr"'
+ autoHeight="true"
+ editOnEnter="true"
+ editStyle="pane"
+ showLoadFilter="true"
+ fmClass="'cza'"
+ defaultSort="['code']"
+ query="{'source': ['[% source_code %]']}">
+ <thead>
+ <tr>
+ <th field="source" fpath="source" ffilter="true"/>
+ <th field="name" fpath="name" ffilter="true"/>
+ <th field="label" fpath="label" ffilter="true"/>
+ <th field="code" fpath="code" ffilter="true"/>
+ <th field="format" fpath="format" ffilter="true"/>
+ <th field="truncation" fpath="truncation" ffilter="true"/>
+ </tr>
+ </thead>
+ </table>
+
+[% ELSE %]
+
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>Z39.50 Servers</div>
<div>
defaultCellWidth='"auto"'
fmClass='czs'
editOnEnter='true'>
+ <thead>
+ <th field='name' formatter='formatSourceName'/>
+ </thead>
</table>
-</div>
[% END %]
+</div>
+
+<script>var sourceCode = '[% source_code %]';</script>
+
+[% END %]
dojo.require('fieldmapper.OrgUtils');
dojo.require('openils.widget.OrgUnitFilteringSelect');
dojo.require('openils.widget.AutoGrid');
+dojo.require('openils.widget.FlattenerGrid');
var zsList;
function buildZSGrid() {
- zsGrid.loadAll({order_by:{czs : 'name'}});
+ if (!sourceCode) {
+ zsGrid.loadAll({order_by:{czs : 'name'}});
+ }
+}
+
+function formatSourceName(val) {
+ return '<a href="' + location.href + '/' + escape(val) + '">' + val + '</a>';
}
openils.Util.addOnLoad(buildZSGrid);