From 2ae1ae94c83e0a216589068dac6ae4fe658a0113 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 27 Oct 2009 02:58:06 +0000 Subject: [PATCH] started on a copy location order interface git-svn-id: svn://svn.open-ils.org/ILS/trunk@14615 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../conify/global/asset/copy_location_order.js | 57 ++++++++++++++++++++++ .../conify/global/asset/copy_location_order.tt2 | 36 ++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js create mode 100644 Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2 diff --git a/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js b/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js new file mode 100644 index 000000000..d23d541be --- /dev/null +++ b/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js @@ -0,0 +1,57 @@ +dojo.require('dijit.layout.ContentPane'); +dojo.require('openils.widget.OrgUnitFilteringSelect'); +dojo.require('fieldmapper.OrgUtils'); +dojo.require('openils.User'); +dojo.require('openils.Util'); +dojo.require('openils.widget.AutoGrid'); +dojo.require('openils.PermaCrud'); + +var user; +var pcrud; +var orders; +var locations; +var tbody; +var template; + +function init() { + + user = new openils.User(); + pcrud = new openils.PermaCrud({authtoken : user.authtoken}); + tbody = dojo.byId('acpl-tbody'); + template = tbody.removeChild(dojo.byId('acpl-tr')); + + + user.buildPermOrgSelector( + 'ADMIN_COPY_LOCATION_ORDER', + contextOrgSelector, + null, + function() { + dojo.connect(contextOrgSelector, 'onChange', filterGrid); + } + ); + + filterGrid(user.user.ws_ou()); +} + +function filterGrid(org) { + orders = pcrud.search('acplo', {org : org}, {order_by : {acplo : 'position'}}); + locations = pcrud.search('acpl', {owning_lib : org}); //TODO + alert(locations.length); + + while(tbody.childNodes[0]) + tbody.removeChild(tbody.childNodes[0]); + + dojo.forEach(locations, + function(loc) { + var row = template.cloneNode(true); + dojo.query('[name=name]', row)[0].innerHTML = loc.name(); + dojo.query('[name=owning_lib]', row)[0].innerHTML = + fieldmapper.aou.findOrgUnit(loc.owning_lib()).shortname(); + tbody.appendChild(row); + console.log(row); + } + ); +} + +openils.Util.addOnLoad(init); + diff --git a/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2 b/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2 new file mode 100644 index 000000000..6e914ba74 --- /dev/null +++ b/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2 @@ -0,0 +1,36 @@ +[% WRAPPER default/base.tt2 %] +[% ctx.page_title = 'Copy Location Order' %] + + +
+
Copy Location Order
+
+ +
+
+ +
+ Context Org Unit + +
+ +
+ + + + + + + + +
NameOwning Lib
+
+ +[% END %] -- 2.11.0