From a456f3343c5e872464d712e84489ac990364d55f Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 11 Jul 2016 11:25:00 -0400 Subject: [PATCH] UI tweak and org deletion Signed-off-by: Jason Etheridge --- .../templates/staff/admin/actor/org_unit/index.tt2 | 2 ++ .../staff/admin/actor/org_unit/t_main_tab.tt2 | 26 +++++++++++++++++++--- .../ui/default/staff/admin/actor/org_unit/app.js | 18 +++++++++++++-- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/templates/staff/admin/actor/org_unit/index.tt2 b/Open-ILS/src/templates/staff/admin/actor/org_unit/index.tt2 index 39a51ee0be..6cfe50bb2f 100644 --- a/Open-ILS/src/templates/staff/admin/actor/org_unit/index.tt2 +++ b/Open-ILS/src/templates/staff/admin/actor/org_unit/index.tt2 @@ -11,6 +11,8 @@ angular.module('egCoreMod').run(['egStrings', function(s) { s.ORG_UPDATE_SUCCESS = "[% l('Org Unit Updated') %]"; s.ORG_UPDATE_FAILURE = "[% l('Org Unit Not Updated') %]"; + s.ORG_DELETE_SUCCESS = "[% l('Org Unit Deleted') %]"; + s.ORG_DELETE_FAILURE = "[% l('Org Unit Not Deleted') %]"; }]) diff --git a/Open-ILS/src/templates/staff/admin/actor/org_unit/t_main_tab.tt2 b/Open-ILS/src/templates/staff/admin/actor/org_unit/t_main_tab.tt2 index 234389309f..95c42b81ce 100644 --- a/Open-ILS/src/templates/staff/admin/actor/org_unit/t_main_tab.tt2 +++ b/Open-ILS/src/templates/staff/admin/actor/org_unit/t_main_tab.tt2 @@ -34,13 +34,33 @@
-
+
- [% l('NOTE: A server-side "autogen" process is needed to complete updates to the Org Hierarchy.') %]
-
+
+
+
+
+
+ +
+
+ [% l('NOTE: A server-side "autogen" process is needed to complete updates, additions, and deletions to the Org Hierarchy.') %]
+
+
+ +
+
+ + [% l('NOTE: In practice, once an org unit has been used or assigned to items, patrons, etc. deletion becomes non-trivial and will require DBA intervention.') %] + [% l('Are you sure?') %] + + +
+
+
diff --git a/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js b/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js index 24b62268d9..ce358de428 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js @@ -112,8 +112,22 @@ function($scope , $q , $routeParams , $window , egCore , egOrg , ngToast ) { ); }; - - + $scope.delete = function() { + var new_org = egOrg.get($scope.org.id); + egCore.pcrud.remove(new_org).then( + function(res) { // success + window.sessionStorage.removeItem('eg.env.aou.tree'); + egCore.env.load(); + init(0); + ngToast.create(egCore.strings.ORG_DELETE_SUCCESS); + }, + function(res) { // failure + ngToast.create(egCore.strings.ORG_DELETE_FAILURE); + }, + function(res) { // progress + } + ); + }; }]) -- 2.11.0