[open-ils-commits] r14615 - in trunk/Open-ILS/web: js/ui/default/conify/global js/ui/default/conify/global/asset templates/default/conify/global templates/default/conify/global/asset (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Oct 26 22:58:08 EDT 2009
Author: erickson
Date: 2009-10-26 22:58:06 -0400 (Mon, 26 Oct 2009)
New Revision: 14615
Added:
trunk/Open-ILS/web/js/ui/default/conify/global/asset/
trunk/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js
trunk/Open-ILS/web/templates/default/conify/global/asset/
trunk/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2
Log:
started on a copy location order interface
Added: trunk/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js 2009-10-27 02:58:06 UTC (rev 14615)
@@ -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);
+
Added: trunk/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/asset/copy_location_order.tt2 2009-10-27 02:58:06 UTC (rev 14615)
@@ -0,0 +1,36 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = 'Copy Location Order' %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/asset/copy_location_order.js'> </script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
+ <div>Copy Location Order</div>
+ <div>
+ <!--
+ <button dojoType='dijit.form.Button' onClick='acplGrid.showCreateDialog()'>New Location Order</button>
+ <button dojoType='dijit.form.Button' onClick='acplGrid.deleteSelected()'>Delete Selected</button>
+ -->
+ </div>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <table>
+ <thead><tr><th>Name</th><th>Owning Lib</th></thead>
+ <tbody id='acpl-tbody'>
+ <tr id='acpl-tr'>
+ <td><span name='name'/></td>
+ <td><span name='owning_lib'/></td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+[% END %]
More information about the open-ils-commits
mailing list