From: senator Date: Mon, 30 Aug 2010 17:02:22 +0000 (+0000) Subject: Basic auto-grid based editor for copy templates. Useful esp. for serials. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4927878a873725ac3818455abb133714845cd2e8;p=evergreen%2Fbjwebb.git Basic auto-grid based editor for copy templates. Useful esp. for serials. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17387 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 639018dc6..3151c01bc 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4406,7 +4406,7 @@ SELECT usr, - + diff --git a/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js b/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js new file mode 100644 index 000000000..70d3812bf --- /dev/null +++ b/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js @@ -0,0 +1,60 @@ +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); diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 9c48de59b..ff0b626d8 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -682,6 +682,8 @@ + + diff --git a/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2 b/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2 new file mode 100644 index 000000000..fa5081bc9 --- /dev/null +++ b/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2 @@ -0,0 +1,33 @@ +[% WRAPPER default/base.tt2 %] +[% ctx.page_title = "Copy Templates" %] + +
+
+
Copy Templates
+
+ + +
+
+
+ Show templates available at or above + +
+ +
+
+[% END %] diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 3eea8211a..d7293f72d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -684,6 +684,12 @@ main.menu.prototype = { ); } ], + "cmd_local_admin_copy_template": [ + ["oncommand"], + function() { + open_eg_web_page("conify/global/asset/copy_template"); + } + ], 'cmd_local_admin_patrons_due_refunds' : [ ['oncommand'], function() { diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul index d65d934f9..4b9db590e 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul @@ -128,6 +128,7 @@ + @@ -373,6 +374,7 @@ +