<class id="act" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_template" oils_persist:tablename="asset.copy_template" reporter:label="Asset Copy Template">
<fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
- <field reporter:label="ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
<field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
<field reporter:label="Creator" name="creator" reporter:datatype="link"/>
<field reporter:label="Editor" name="editor" reporter:datatype="link"/>
--- /dev/null
+dojo.require("dojo.data.ItemFileWriteStore");
+dojo.require("dijit.form.CurrencyTextBox");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require("openils.widget.AutoGrid");
+dojo.require("openils.PermaCrud");
+dojo.require("openils.widget.OrgUnitFilteringSelect");
+
+var pcrud;
+var actOwner;
+var actList;
+
+function actInit() {
+ pcrud = new openils.PermaCrud();
+
+ new openils.User().buildPermOrgSelector(
+ "ADMIN_ASSET_COPY_TEMPLATE",
+ actOwnerSelect,
+ null,
+ function() {
+ dojo.connect(
+ actOwnerSelect,
+ "onChange",
+ function() {
+ actOwner = fieldmapper.aou.findOrgUnit(this.attr("value"));
+ actGrid.resetStore();
+ buildActGrid();
+ }
+ );
+ buildActGrid();
+ }
+ );
+}
+
+function buildActGrid() {
+ if (!actOwner)
+ actOwner = fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou());
+
+ pcrud.search(
+ "act", {
+ "owning_lib": fieldmapper.aou.orgNodeTrail(actOwner, true /* asId */)
+ }, {
+ "async": true,
+ "onresponse": function(r) {
+ if ((actList = openils.Util.readResponse(r))) {
+ actList = openils.Util.objectSort(actList);
+ actList.forEach(
+ function(o) {
+ actGrid.store.newItem(act.toStoreItem(o));
+ }
+ );
+ }
+ },
+ "oncomplete": function() {
+ actGrid.hideLoadProgressIndicator();
+ }
+ }
+ );
+}
+
+openils.Util.addOnLoad(actInit);
<!ENTITY staff.main.menu.admin.local_admin.hold_matrix_matchpoint.label "Hold Policies">
<!ENTITY staff.main.menu.admin.local_admin.work_log.label "Work Log">
<!ENTITY staff.main.menu.admin.local_admin.work_log.accesskey "W">
+<!ENTITY staff.main.menu.admin.local_admin.copy_template.label "Copy Template Editor">
+<!ENTITY staff.main.menu.admin.local_admin.copy_template.accesskey "T">
<!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.label "Patrons with Negative Balances">
<!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.accesskey "N">
--- /dev/null
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = "Copy Templates" %]
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/conify/global/asset/copy_template.js"> </script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div dojoType="dijit.layout.ContentPane"
+ layoutAlign="top" class="oils-header-panel">
+ <div>Copy Templates</div>
+ <div>
+ <button dojoType="dijit.form.Button"
+ onClick="actGrid.showCreateDialog()">New Copy Template</button>
+ <button dojoType="dijit.form.Button"
+ onClick="actGrid.deleteSelected()">Delete Selected</button>
+ </div>
+ </div>
+ <div class="oils-acq-basic-roomy">
+ <span>Show templates available at or above</span>
+ <select
+ dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId="actOwnerSelect"
+ searchAttr="shortname" labelAttr="shortname">
+ </select>
+ </div>
+ <table jsId="actGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['name', 'owning_lib']"
+ suppressFields="['creator','editor','edit_date', 'create_date']"
+ query="{id: '*'}"
+ fmClass="act"
+ autoHeight="true"
+ editOnEnter="true">
+ </table>
+</div>
+[% END %]
);
}
],
+ "cmd_local_admin_copy_template": [
+ ["oncommand"],
+ function() {
+ open_eg_web_page("conify/global/asset/copy_template");
+ }
+ ],
'cmd_local_admin_patrons_due_refunds' : [
['oncommand'],
function() {
<command id="cmd_local_admin_hold_matrix_matchpoint"/>
<command id="cmd_local_admin_work_log"/>
<command id="cmd_local_admin_patrons_due_refunds"/>
+ <command id="cmd_local_admin_copy_template"/>
<!-- server admin menu commands -->
<command id="cmd_server_admin_org_type"/>
<menuitem label="&staff.main.menu.admin.local_admin.conify.survey.label;" command="cmd_local_admin_survey"/>
<menuitem label="&staff.server.admin.index.transit_list;" command="cmd_local_admin_transit_list"/>
<menuitem label="&staff.main.menu.admin.local_admin.work_log.label;" accesskey="&staff.main.menu.admin.local_admin.work_log.accesskey;" command="cmd_local_admin_work_log"/>
+ <menuitem label="&staff.main.menu.admin.local_admin.copy_template.label;" accesskey="&staff.main.menu.admin.local_admin.copy_template.accesskey;" command="cmd_local_admin_copy_template"/>
</menupopup>
</menu>
<menu id="main.menu.admin.server" label="&staff.main.menu.admin.server_admin.label;">