webstaff: browser client local admin re-org; adding new links
authorBill Erickson <berickxx@gmail.com>
Sat, 25 Jul 2015 18:10:37 +0000 (14:10 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:52 +0000 (14:58 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/admin/actor/index.tt2 [deleted file]
Open-ILS/src/templates/staff/admin/actor/t_address_alert.tt2 [deleted file]
Open-ILS/src/templates/staff/admin/circ/index.tt2 [deleted file]
Open-ILS/src/templates/staff/admin/circ/t_age_to_lost.tt2 [deleted file]
Open-ILS/src/templates/staff/admin/local_admin.tt2 [deleted file]
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/admin/actor/app.js
Open-ILS/web/js/ui/default/staff/admin/circ/app.js [deleted file]
Open-ILS/web/js/ui/default/staff/services/ui.js

diff --git a/Open-ILS/src/templates/staff/admin/actor/index.tt2 b/Open-ILS/src/templates/staff/admin/actor/index.tt2
deleted file mode 100644 (file)
index 5a3ba07..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-[%
-  WRAPPER "staff/base.tt2";
-  ctx.page_title = l("Evergreen Configuration"); 
-  ctx.page_app = "egAdminActor";
-%]
-
-[% BLOCK APP_JS %]
-<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
-<script src="[% ctx.media_prefix %]/js/ui/default/staff/admin/actor/app.js"></script>
-[% END %]
-
-<div ng-view></div>
-
-[% END %]
diff --git a/Open-ILS/src/templates/staff/admin/actor/t_address_alert.tt2 b/Open-ILS/src/templates/staff/admin/actor/t_address_alert.tt2
deleted file mode 100644 (file)
index c84c9e2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<eg-embed-frame url="address_alert_url" handlers="funcs"></eg-embed-frame>
diff --git a/Open-ILS/src/templates/staff/admin/circ/index.tt2 b/Open-ILS/src/templates/staff/admin/circ/index.tt2
deleted file mode 100644 (file)
index 50c52b8..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[%
-  WRAPPER "staff/base.tt2";
-  ctx.page_title = l("Evergreen Configuration"); 
-  ctx.page_app = "egAdminCirc";
-%]
-
-[% BLOCK APP_JS %]
-<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
-<script src="[% ctx.media_prefix %]/js/ui/default/staff/admin/circ/app.js"></script>
-<link rel="stylesheet" href="[% ctx.base_path %]/staff/css/admin.css" />
-[% END %]
-
-<div ng-view></div>
-
-[% END %]
diff --git a/Open-ILS/src/templates/staff/admin/circ/t_age_to_lost.tt2 b/Open-ILS/src/templates/staff/admin/circ/t_age_to_lost.tt2
deleted file mode 100644 (file)
index c1e28dd..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<div class="container-fluid" style="text-align:center">
-  <div class="alert alert-info alert-less-pad strong-text-2">
-    [% l('Age Circulations to Lost') %]
-  </div>
-</div>
-
-<span>
-[% | l %]
-Choose the user profile and circulation library for the overdue circulations
-you wish to age to a Lost status.  Note the descendants of these values 
-(sub-groups, sub-libraries) will also be affected.
-[% END %]
-</span>
-
-<div id='age-to-lost-container'>
-  <div xclass="form-inline">
-    <div class="form-group">
-      <label class="col-md-2">[% l('User Profile') %]</label>
-      <div class="btn-group" dropdown>
-        <button type="button" class="btn btn-default dropdown-toggle">
-          <span style="padding-right: 5px;">{{selected_profile.name()}}</span>
-          <span class="caret"></span>
-        </button>
-        <ul class="dropdown-menu">
-          <li ng-repeat="grp in profiles">
-            <a href
-              style="padding-left: {{pgt_depth(grp) * 10 + 5}}px"
-              ng-click="set_profile(grp)">{{grp.name()}}</a>
-          </li>
-        </ul>
-      </div>
-    </div>
-    <div class="form-group">
-      <label class="col-md-2">[% l('Circulation Library') %]</label>
-      <eg-org-selector selected="context_org"></eg-org-selector>
-    </div>
-    <div class="form-group">
-      <label class="col-md-2">[% l('Are you sure?') %]</label>
-      <input type="checkbox" ng-model="i_am_sure"/>
-    </div>
-  </div>
-    <div class="form-group">
-      <button class="btn btn-default" 
-        ng-class="{disabled : !i_am_sure}" ng-click="age_to_lost()">
-        [% l('Queue for Aging') %]</button>
-    </div>
-  </div>
-
-  <div class="row" ng-show="in_progress">
-    <div class="col-md-3"></div>
-    <div class="progress progress-striped active col-md-6">
-      <div class="progress-bar" role="progressbar" aria-valuenow="100" 
-        aria-valuemin="0" aria-valuemax="100" style="width: 100%">
-        <span class="sr-only">[% l('Processing...') %]</span>
-      </div>
-    </div>
-  </div>
-
-  <div class="row" ng-show="in_progress || all_done">
-    <div class="col-md-3"></div>
-    <div class="col-md-3">
-      [% l('Chunks Processed: [_1]', '{{chunks_processed}}') %]</div>
-    <div class="col-md-3">
-      [% l('Events Created: [_1]', '{{events_created}}') %]</div>
-    </div>
-  </div>
-
-  <div class="row" ng-show="all_done">
-    <div class="col-md-3"></div>
-    <div class="col-md-6">
-     <div class="alert alert-success" role="alert">
-      [% l('Processing Complete') %]</div>
-    </div>
-  </div>
-
-</div>
-   
-
-
-
diff --git a/Open-ILS/src/templates/staff/admin/local_admin.tt2 b/Open-ILS/src/templates/staff/admin/local_admin.tt2
deleted file mode 100644 (file)
index ed0590e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-[%
-  WRAPPER "staff/base.tt2";
-  ctx.page_title = l("Local Administration"); 
-  ctx.page_app = "egLocalAdmin";
-%]
-
-[% BLOCK APP_JS %]
-<script>
-  /* just enough JS for the the navbar to display */
-  angular.module('egLocalAdmin', ['ngRoute', 'ui.bootstrap', 'egCoreMod']);
-</script>
-<link rel="stylesheet" href="[% ctx.base_path %]/staff/css/admin.css" />
-[% END %]
-
-<div class="container-fluid" style="text-align:center">
-  <div class="alert alert-info alert-less-pad strong-text-2">
-    <span>[% l('Local Administration') %]</span>
-  </div>
-</div>
-
-<div class="container admin-splash-container">
-
-  <div class="row new-entry">
-    <div class="col-md-3">
-      <span class="glyphicon glyphicon-pencil"></span>
-      <a target="_self" href="./admin/actor/address_alert">
-        [% l('Address Alerts') %]
-      </a>
-    </div>
-  </div>
-  <div class="row new-entry">
-    <div class="col-md-3">
-      <span class="glyphicon glyphicon-pencil"></span>
-      <a target="_self" href="./admin/circ/age_to_lost">
-        [% l('Age Overdue Circs to Lost') %]
-      </a>
-    </div>
-  </div>
-
-</div>
-
-
-[% END %]
index afe2c9c..28d8fd9 100644 (file)
             </a>
           </li>
           <li>
-            <a href="./admin/local_admin" target="_self">
+            <a href="./admin/local/index" target="_self">
               <span class="glyphicon glyphicon-picture"></span>
               [% l('Local Administration') %]
             </a>
index 94ac8e5..8fc04d1 100644 (file)
@@ -34,8 +34,6 @@ angular.module('egAdminActor',
        ['$scope','$routeParams','$window','$location','egCore',
 function($scope , $routeParams , $window , $location , egCore) {
 
-    console.log('addr alert');
-    
     $scope.funcs = {
         ses : egCore.auth.token(),
     }
diff --git a/Open-ILS/web/js/ui/default/staff/admin/circ/app.js b/Open-ILS/web/js/ui/default/staff/admin/circ/app.js
deleted file mode 100644 (file)
index 24d3aad..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * App to drive the base page. 
- * Login Form
- * Splash Page
- */
-
-angular.module('egAdminCirc',
-    ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod'])
-
-.config(['$routeProvider','$locationProvider','$compileProvider', 
- function($routeProvider , $locationProvider , $compileProvider) {
-
-    $locationProvider.html5Mode(true);
-    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); 
-    var resolver = {delay : function(egStartup) {return egStartup.go()}};
-
-    $routeProvider.when('/admin/circ/age_to_lost', {
-        templateUrl: './admin/circ/t_age_to_lost',
-        controller: 'AgeToLostCtl',
-        resolve : resolver
-    });
-
-    // default page 
-    /*
-    $routeProvider.otherwise({
-        templateUrl : 'user-perms-template',
-        controller: 'UserPermsCtrl',
-        resolve : resolver
-    });
-    */
-}])
-
-.controller('AgeToLostCtl',
-       ['$scope','egCore',
-function($scope , egCore) {
-    $scope.i_am_sure = false;
-    $scope.chunks_processed = 0;
-    $scope.events_created = 0;
-
-    egCore.pcrud.search('pgt', {parent : null}, 
-        {flesh : -1, flesh_fields : {pgt : ['children']}}
-    ).then(
-        function(tree) {
-            egCore.env.absorbTree(tree, 'pgt')
-            $scope.profiles = egCore.env.pgt.list;
-            $scope.selected_profile = tree;
-        }
-    );
-
-    $scope.set_profile = function(g) {$scope.selected_profile = g}
-
-    // determine the tree depth of the profile group
-    $scope.pgt_depth = function(grp) {
-        var d = 0;
-        while (grp = egCore.env.pgt.map[grp.parent()]) d++;
-        return d;
-    }
-
-    $scope.age_to_lost = function() {
-        $scope.in_progress = true;
-        $scope.i_am_sure = false; // reset
-        $scope.all_done = false;
-
-        egCore.net.request(
-            'open-ils.circ',
-            'open-ils.circ.circulation.age_to_lost',
-            egCore.auth.token(), {
-                user_profile : $scope.selected_profile.id(),
-                circ_lib : $scope.context_org.id()
-            }
-        ).then(
-            function() {
-                $scope.in_progress = false;
-                $scope.all_done = true;
-            },
-            null, // on-error
-            function(response) {
-                if (!response) return;
-                if (response.progress)
-                    $scope.chunks_processed = response.progress;
-                if (response.created)
-                    $scope.events_created = response.created;
-            }
-        );
-    }
-}])
index d52382c..f5ce418 100644 (file)
@@ -314,8 +314,8 @@ function($modal, $interpolate) {
            + '</ul>'
           + '</div>',
 
-        controller : ['$scope','$timeout','egOrg','egAuth','egCore',
-              function($scope , $timeout , egOrg , egAuth , egCore) {
+        controller : ['$scope','$timeout','egOrg','egAuth','egCore','egStartup',
+              function($scope , $timeout , egOrg , egAuth , egCore , egStartup) {
 
             if ($scope.alldisabled) {
                 $scope.disable_button = $scope.alldisabled == 'true' ? true : false;
@@ -329,12 +329,22 @@ function($modal, $interpolate) {
 
             // avoid linking the full fleshed tree to the scope by 
             // tossing in a flattened list.
-            $scope.orgList = egOrg.list().map(function(org) {
-                return {
-                    id : org.id(),
-                    shortname : org.shortname(), 
-                    depth : org.ou_type().depth()
-                }
+            // --
+            // Run-time code referencing post-start data should be run
+            // from within a startup block, otherwise accessing this
+            // module before startup completes will lead to failure.
+            egStartup.go().then(function() {
+
+                $scope.orgList = egOrg.list().map(function(org) {
+                    return {
+                        id : org.id(),
+                        shortname : org.shortname(), 
+                        depth : org.ou_type().depth()
+                    }
+                });
+
+                if (!$scope.selected)
+                    $scope.selected = egOrg.get(egAuth.user().ws_ou());
             });
 
             $scope.getSelectedName = function() {