LP#1537223 Show Username on copy buckets
authorKyle Huckins <khuckins@catalystdevworks.com>
Thu, 6 Oct 2016 16:17:19 +0000 (09:17 -0700)
committerKathy Lussier <klussier@masslnc.org>
Fri, 3 Mar 2017 14:25:42 +0000 (09:25 -0500)
Display bucket owner name, id, and owner's home OU on copy
buckets and record buckets in webstaff client.

Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Dawn Dale <ddale@georgialibraries.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

15 files changed:
Open-ILS/src/templates/staff/cat/bucket/copy/index.tt2
Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_edit.tt2 [deleted file]
Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_info.tt2 [deleted file]
Open-ILS/src/templates/staff/cat/bucket/record/index.tt2
Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_create.tt2 [deleted file]
Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_delete.tt2 [deleted file]
Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_selector.tt2 [deleted file]
Open-ILS/src/templates/staff/cat/bucket/share/t_bucket_create.tt2 [moved from Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_create.tt2 with 96% similarity]
Open-ILS/src/templates/staff/cat/bucket/share/t_bucket_delete.tt2 [moved from Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_delete.tt2 with 100% similarity]
Open-ILS/src/templates/staff/cat/bucket/share/t_bucket_edit.tt2 [moved from Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_edit.tt2 with 96% similarity]
Open-ILS/src/templates/staff/cat/bucket/share/t_bucket_info.tt2 [moved from Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_info.tt2 with 70% similarity]
Open-ILS/src/templates/staff/cat/bucket/share/t_bucket_selector.tt2 [moved from Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_selector.tt2 with 100% similarity]
Open-ILS/src/templates/staff/cat/bucket/share/t_load_shared.tt2 [moved from Open-ILS/src/templates/staff/cat/bucket/copy/t_load_shared.tt2 with 100% similarity]
Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index aa80153..bcc0366 100644 (file)
@@ -55,7 +55,7 @@ changing routes with each tab selection anyway.
     <!-- bucket info header -->
     <div class="row">
       <div class="col-md-6">
-        [% INCLUDE 'staff/cat/bucket/copy/t_bucket_info.tt2' %]
+        [% INCLUDE 'staff/cat/bucket/share/t_bucket_info.tt2' %]
       </div>
     </div>
 
diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_edit.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_edit.tt2
deleted file mode 100644 (file)
index 288c577..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- edit bucket dialog -->
-<form class="form-validated" novalidate ng-submit="ok(args)" name="form">
-  <div>
-    <div class="modal-header">
-      <button type="button" class="close" 
-        ng-click="cancel()" aria-hidden="true">&times;</button>
-      <h4 class="modal-title">[% l('Edit Bucket') %]</h4>
-    </div>
-    <div class="modal-body">
-      <div class="form-group">
-        <label for="edit-bucket-name">[% l('Name') %]</label>
-        <input type="text" class="form-control" focus-me='focusMe' required
-          id="edit-bucket-name" ng-model="args.name" placeholder="[% l('Name...') %]"/>
-      </div>
-      <div class="form-group">
-        <label for="edit-bucket-desc">[% l('Description') %]</label>
-        <input type="text" class="form-control" id="edit-bucket-desc"
-          ng-model="args.desc" placeholder="[% l('Description...') %]"/>
-      </div>
-       <div class="checkbox">
-        <label>
-          <input ng-model="args.pub" type="checkbox"> 
-          [% l('Publicly Visible?') %]
-        </label>
-      </div>
-    </div>
-    <div class="modal-footer">
-      <input type="submit" class="btn btn-primary" 
-          ng-disabled="form.$invalid" value="[% l('Apply Changes') %]"/>
-      <button class="btn btn-warning" ng-click="cancel()"
-          ng-class="{disabled : actionPending}">[% l('Cancel') %]</button>
-    </div>
-  </div> <!-- modal-content -->
-</form>
diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_info.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_bucket_info.tt2
deleted file mode 100644 (file)
index 877fcf6..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-<div ng-show="bucket()">
-  <strong>[% l('Bucket: {{bucket().name()}}') %]</strong> 
-  <span>
-    <ng-pluralize count="bucketSvc.currentBucket.items().length"
-      when="{'one': '[% l("1 item") %]', 'other': '[% l("{} items") %]'}">
-    </ng-pluralize>
-  </span> 
-  <span> / [% l('Created {{bucket().create_time() | date}}') %]</span>
-  <span ng-show="bucket().description()"> / {{bucket().description()}}</span>
-</div>
-
-<div ng-show="!bucket()">
-  <strong>[% l('No Bucket Selected') %]</strong>
-</div>
-
index 24b5ac9..5ef7994 100644 (file)
@@ -60,7 +60,7 @@ changing routes with each tab selection anyway.
     <!-- bucket info header -->
     <div class="row">
       <div class="col-md-6">
-        [% INCLUDE 'staff/cat/bucket/record/t_bucket_info.tt2' %]
+        [% INCLUDE 'staff/cat/bucket/share/t_bucket_info.tt2' %]
       </div>
     </div>
 
diff --git a/Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_create.tt2 b/Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_create.tt2
deleted file mode 100644 (file)
index e6bb3fe..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!-- edit bucket dialog -->
-
-<!-- use <form> so we get submit-on-enter for free -->
-<form class="form-validated" novalidate name="form" ng-submit="ok(args)">
-  <div>
-    <div class="modal-header">
-      <button type="button" class="close" 
-        ng-click="cancel()" aria-hidden="true">&times;</button>
-      <h4 class="modal-title">[% l('Create Bucket') %]</h4>
-    </div>
-    <div class="modal-body">
-      <div class="form-group">
-        <label for="edit-bucket-name">[% l('Name') %]</label>
-        <input type="text" class="form-control" focus-me='focusMe' required
-          id="edit-bucket-name" ng-model="args.name" placeholder="[% l('Name...') %]"/>
-      </div>
-      <div class="form-group">
-        <label for="edit-bucket-desc">[% l('Description') %]</label>
-        <input type="text" class="form-control" id="edit-bucket-desc"
-          ng-model="args.desc" placeholder="[% l('Description...') %]"/>
-      </div>
-       <div class="checkbox">
-        <label>
-          <input ng-model="args.pub" type="checkbox"/> 
-          [% l('Publicly Visible?') %]
-        </label>
-      </div>
-    </div>
-    <div class="modal-footer">
-      <input type="submit" ng-disabled="form.$invalid" 
-          class="btn btn-primary" value="[% l('Create Bucket') %]"/>
-      <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
-    </div>
-  </div> <!-- modal-content -->
-</form>
diff --git a/Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_delete.tt2 b/Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_delete.tt2
deleted file mode 100644 (file)
index 0ca9887..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class="modal-dialog">
-  <div class="modal-content">
-    <div class="modal-header">
-      <button type="button" class="close" 
-        ng-click="cancel()" aria-hidden="true">&times;</button>
-      <h4 class="modal-title">[% l('Confirm Bucket Delete') %]</h4>
-    </div>
-    <div class="modal-body">
-      <p>[% l('Delete bucket {{bucket().name()}}?') %]</p>
-    </div>
-    <div class="modal-footer">
-      <button class="btn btn-primary" ng-click="ok()">[% l('Delete Bucket') %]</button>
-      <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
-    </div>
-  </div> <!-- modal-content -->
-</div> <!-- modal-dialog -->
diff --git a/Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_selector.tt2 b/Open-ILS/src/templates/staff/cat/bucket/record/t_bucket_selector.tt2
deleted file mode 100644 (file)
index e9aeacc..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<div class="btn-group text-left" uib-dropdown>
-  <button type="button" class="btn btn-default" uib-dropdown-toggle>
-    [% l('Buckets') %]<span class="caret"></span>
-  </button>
-  <ul uib-dropdown-menu>
-    <li>
-      <a href='' ng-click="openCreateBucketDialog()">[% l('New Bucket') %]</a>
-    </li>
-    <li ng-class="{disabled : !bucket()}">
-      <a href='' ng-click="openEditBucketDialog()">[% l('Edit Bucket') %]</a>
-    </li>
-    <li ng-class="{disabled : !bucket()}">
-      <a href='' ng-click="openDeleteBucketDialog()">[% l('Delete Bucket') %]</a>
-    </li>
-    <li>
-      <a href='' ng-click="openSharedBucketDialog()">[% l('Load Shared Bucket') %]</a>
-    </li>
-    <li role="presentation" class="divider"></li>
-
-    <!-- list all of this user's buckets -->
-    <li ng-repeat="bkt in bucketSvc.allBuckets" 
-      ng-class="{disabled : bkt.id() == bucket().id()}">
-      <a href='' ng-click="loadBucket(bkt.id())">{{bkt.name()}}</a>
-    </li>
-  </ul>
-</div>
-
@@ -21,7 +21,7 @@
       </div>
        <div class="checkbox">
         <label>
-          <input ng-model="args.pub" type="checkbox"/> 
+          <input ng-model="args.pub" type="checkbox"/>
           [% l('Publicly Visible?') %]
         </label>
       </div>
@@ -19,7 +19,7 @@
       </div>
        <div class="checkbox">
         <label>
-          <input ng-model="args.pub" type="checkbox"> 
+          <input ng-model="args.pub" type="checkbox">
           [% l('Publicly Visible?') %]
         </label>
       </div>
@@ -1,12 +1,13 @@
 
 <div ng-show="bucket()">
-  <strong>[% l('Bucket: {{bucket().name()}}') %]</strong> 
+  <strong>[% l('Bucket #{{bucket().id()}}: {{bucket().name()}}') %]</strong>
   <span>
     <ng-pluralize count="bucketSvc.currentBucket.items().length"
       when="{'one': '[% l("1 item") %]', 'other': '[% l("{} items") %]'}">
     </ng-pluralize>
-  </span> 
+  </span>
   <span> / [% l('Created {{bucket().create_time() | date}}') %]</span>
+  <span ng-show="bucket()._owner_name"> / {{bucket()._owner_name}} @ {{bucket()._owner_ou}}</span>
   <span ng-show="bucket().description()"> / {{bucket().description()}}</span>
 </div>
 
index e3b068e..efd8ab1 100644 (file)
@@ -153,6 +153,13 @@ angular.module('egCatCopyBuckets',
                 deferred.reject(evt);
                 return;
             }
+            egCore.pcrud.retrieve(
+                'au', bucket.owner()
+            ).then(function(patron) {
+                bucket._owner_name = patron.usrname();
+                bucket._owner_ou = egCore.org.get(patron.home_ou()).shortname();
+            });
+
             service.currentBucket = bucket;
             deferred.resolve(bucket);
         });
@@ -265,7 +272,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
 
     $scope.openCreateBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/copy/t_bucket_create',
+            templateUrl: './cat/bucket/share/t_bucket_create',
             controller: 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.focusMe = true;
@@ -289,7 +296,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
 
     $scope.openEditBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/copy/t_bucket_edit',
+            templateUrl: './cat/bucket/share/t_bucket_edit',
             controller: 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.focusMe = true;
@@ -315,7 +322,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
     // bucket if the user confirms.
     $scope.openDeleteBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/copy/t_bucket_delete',
+            templateUrl: './cat/bucket/share/t_bucket_delete',
             controller : 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.bucket = function() { return bucketSvc.currentBucket }
@@ -334,7 +341,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
     // retrieves the requested bucket by ID
     $scope.openSharedBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/copy/t_load_shared',
+            templateUrl: './cat/bucket/share/t_load_shared',
             controller :
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.focusMe = true;
index b6c4661..a1d63ee 100644 (file)
@@ -166,6 +166,12 @@ angular.module('egCatRecordBuckets',
                 deferred.reject(evt);
                 return;
             }
+            egCore.pcrud.retrieve(
+                'au', bucket.owner()
+            ).then(function(patron) {
+                bucket._owner_name = patron.usrname();
+                bucket._owner_ou = egCore.org.get(patron.home_ou()).shortname();
+            });
             service.currentBucket = bucket;
             deferred.resolve(bucket);
         });
@@ -296,7 +302,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
 
     $scope.openCreateBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/record/t_bucket_create',
+            templateUrl: './cat/bucket/share/t_bucket_create',
             controller: 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.focusMe = true;
@@ -320,7 +326,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
 
     $scope.openEditBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/record/t_bucket_edit',
+            templateUrl: './cat/bucket/share/t_bucket_edit',
             controller: 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.focusMe = true;
@@ -347,7 +353,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
     // bucket if the user confirms.
     $scope.openDeleteBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/record/t_bucket_delete',
+            templateUrl: './cat/bucket/share/t_bucket_delete',
             controller : 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.bucket = function() { return bucketSvc.currentBucket }
@@ -366,7 +372,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
     // retrieves the requested bucket by ID
     $scope.openSharedBucketDialog = function() {
         $uibModal.open({
-            templateUrl: './cat/bucket/record/t_load_shared',
+            templateUrl: './cat/bucket/share/t_load_shared',
             controller : 
                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                 $scope.focusMe = true;