From f8f404b99447eb0b9af5e94399957394c29e66cb Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 2 Apr 2012 13:18:15 -0400 Subject: [PATCH] Revert "Org unit sibling display sort order : admin UI" This reverts commit 1108cfc0b3978dc0fd80566a2b654edcf6b99d55. Signed-off-by: Bill Erickson --- .../actor/org_unit/sibling_order.tt2 | 57 ---------- .../default/actor/org_unit/sibling_order.js | 103 ------------------ Open-ILS/web/opac/locale/en-US/lang.dtd | 1 - .../staff_client/chrome/content/main/menu.js | 11 -- .../chrome/content/main/menu_frame_menus.xul | 2 - .../chrome/locale/en-US/offline.properties | 1 - 6 files changed, 175 deletions(-) delete mode 100644 Open-ILS/src/templates/actor/org_unit/sibling_order.tt2 delete mode 100644 Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js diff --git a/Open-ILS/src/templates/actor/org_unit/sibling_order.tt2 b/Open-ILS/src/templates/actor/org_unit/sibling_order.tt2 deleted file mode 100644 index 49050c3924..0000000000 --- a/Open-ILS/src/templates/actor/org_unit/sibling_order.tt2 +++ /dev/null @@ -1,57 +0,0 @@ -[% WRAPPER base.tt2 %] -[% ctx.page_title = l('Org Unit Sibling Order') %] - - - -

[% l('Org Unit Sibling Order') %]

-
- -
-
-
- -
- - - - - - - -
- - - -
-
-
-
-
    -
  1. [% l('Select the org unit whose children you wish to sort.') %]
  2. -
  3. [% l('Drag the child org units up or down to change the position.') %]
  4. -
  5. [% l('After each drag operation, the changes are automatically saved.') %]
  6. -
  7. [% l('When finished, it will be necessary to restart/reload the web server (Apache) for the changes to take effect.') %]
  8. -
-
-
-
- - -[% END %] diff --git a/Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js b/Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js deleted file mode 100644 index c06d98d3ee..0000000000 --- a/Open-ILS/web/js/ui/default/actor/org_unit/sibling_order.js +++ /dev/null @@ -1,103 +0,0 @@ -dojo.require("dijit.form.Button"); -dojo.require("dojo.dnd.Source"); -dojo.require("openils.User"); -dojo.require("openils.Util"); -dojo.require("openils.PermaCrud"); -dojo.require('openils.widget.OrgUnitFilteringSelect'); - -var user; -var pcrud; -var dndSource; - -function pageInit() { - user = new openils.User(); - pcrud = new openils.PermaCrud({authtoken : user.authtoken}); - fieldmapper.aou.slim_ok = false; // we need full orgs for updates - - user.buildPermOrgSelector( - ['UPDATE_ORG_UNIT', 'ADMIN_ORG_UNIT'], - contextOrgSelector, - null, - function() { - dojo.connect(contextOrgSelector, 'onChange', drawChildren) - // set the value to the root of the tree (instead of ws_ou). - contextOrgSelector.store.fetch({ - query : {id : '*'}, - onComplete : function(list) { - contextOrgSelector.attr('value', list[0].id); - } - }); - } - ); -} - -var tbody, rowTmpl; -function drawChildren() { - - if(!tbody) { - tbody = dojo.byId('child-tbody'); - rowTmpl = tbody.removeChild(dojo.byId('row-template')); - dndSource = new dojo.dnd.Source(tbody); - dojo.connect(dndSource, 'onDndDrop', updateSiblingOrder); - } - - dndSource.selectAll(); - dndSource.deleteSelectedNodes(); - dndSource.clearItems(); - - var org = fieldmapper.aou.findOrgUnit(contextOrgSelector.attr('value')); - if (!org.children()) return; - - // fetch the full child org units - org.children( - org.children().map( - function(c) { return fieldmapper.aou.findOrgUnit(c.id()) } - ) - ); - - // sort by sibling order, fall back to name - var children = org.children().sort( - function(a, b) { - if (a.sibling_order() < b.sibling_order()) { - return -1; - } else if (a.sibling_order() > b.sibling_order()) { - return 1; - } else if (a.name() < b.name()) { - return -1; - } - return 1; - } - ); - - dojo.forEach( - children, - function(child) { - var row = tbody.appendChild(rowTmpl.cloneNode(true)); - row.setAttribute('child', child.id()); - dojo.query('[name=name]', row)[0].innerHTML = child.name(); - dndSource.insertNodes(false, [row]); - } - ); -} - -function updateSiblingOrder() { - var pos = 0; - var toUpdate = []; - dojo.forEach( - dndSource.getAllNodes(), - function(node) { - childId = node.getAttribute('child'); - var child = fieldmapper.aou.findOrgUnit(childId); - if (child.sibling_order() != pos) { - child.sibling_order(pos); - toUpdate.push(child); - } - pos++; - } - ); - - if (toUpdate.length == 0) return; - pcrud.update(toUpdate); // run sync to prevent UI changes mid-update -} - -openils.Util.addOnLoad(pageInit); diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index bffcaee60e..024419d9bf 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2073,7 +2073,6 @@ - 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 bc35694185..4ca96d828a 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1106,17 +1106,6 @@ main.menu.prototype = { ); } ], - 'cmd_local_admin_lib_sort_order' : [ - ['oncommand'], - function(event) { - open_eg_web_page( - "/eg/actor/org_unit/sibling_order", - "menu.cmd_local_admin_lib_sort_order.tab", - event - ); - } - ], - 'cmd_reprint' : [ ['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 67752f53e4..bd98d4bb8d 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 @@ -124,7 +124,6 @@ /> - @@ -506,7 +505,6 @@ - diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index 4f303139b1..961ad06867 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -252,7 +252,6 @@ menu.cmd_booking_resource.tab=Resources menu.cmd_booking_reservation.tab=Reservations menu.cmd_booking_reservation_pickup.tab=Reservation Pickup menu.cmd_booking_reservation_return.tab=Reservation Return -menu.cmd_local_admin_lib_sort_order.tab=Library Sort Order menu.cmd_booking_pull_list.tab=Booking Pull List menu.cmd_booking_capture.tab=Booking Capture menu.cmd_authority_manage.tab=Manage Authorities -- 2.43.2