[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. 43730edd4ac24af9fe132dc9005b5060055b1c60
Evergreen Git
git at git.evergreen-ils.org
Tue Sep 18 14:22:23 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_3_0 has been updated
via 43730edd4ac24af9fe132dc9005b5060055b1c60 (commit)
from 4939e9dc6c8a280a23106e3aac81d54e4f485171 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 43730edd4ac24af9fe132dc9005b5060055b1c60
Author: Jason Boyer <jboyer at library.in.gov>
Date: Thu Jun 21 15:57:41 2018 -0400
LP1735816: Delete Copy Notes in the Web Client
A combination of calling convention errors and
template picky-ness prevented the deletion of
copy notes in the web client. This patch returns
that ability.
Signed-off-by: Jason Boyer <jboyer at library.in.gov>
Signed-off-by: Amy Constantino <aconstantino at cwmars.org>
Signed-off-by: Jason Stephenson <jason at sigio.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm
index 14a52d4..893612d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm
@@ -250,7 +250,7 @@ sub update_copy_notes {
} elsif ($incoming_note->ischanged) {
$incoming_note = $editor->update_asset_copy_note($incoming_note)
} elsif ($incoming_note->isdeleted) {
- $incoming_note = $editor->delete_asset_copy_note($incoming_note->id)
+ $incoming_note = $editor->delete_asset_copy_note($incoming_note)
}
}
diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2
index a679afa..671b3e9 100644
--- a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2
+++ b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2
@@ -52,12 +52,12 @@
</div>
</div>
- <div class="row" ng-repeat="n in note_list" ng-init="pub = n.pub() == 't'; title = n.title(); value = n.value(); deleted = n.isdeleted()">
- <div class="col-md-12">
+ <div class="row" ng-repeat="n in note_list" ng-init="pub = n.pub() == 't'; title = n.title(); value = n.value()">
+ <div class="col-md-12" ng-show="!n.isdeleted()">
<div class="row">
<div class="col-md-6">
<input class="form-control" type="text" ng-change="n.title(title) && n.ischanged(1)"
- ng-model="title" placeholder="[% l('Title...') %]" ng-disabled="deleted"/>
+ ng-model="title" placeholder="[% l('Title...') %]""/>
</div>
<div class="col-md-3">
<label>
@@ -66,16 +66,13 @@
</label>
</div>
<div class="col-md-3">
- <label>
- <input type="checkbox" ng-model="deleted" ng-change="n.isdeleted(deleted)"/>
- [% l('Deleted?') %]
- </label>
+ <button type="button" ng-click="n.isdeleted(1)" class="btn btn-warning">[% l('Remove') %]</button>
</div>
</div>
<div class="row pad-vert">
<div class="col-md-10">
<textarea class="form-control" ng-change="n.value(value) && n.ischanged(1)"
- ng-model="value" placeholder="[% l('Note...') %]" ng-disabled="deleted">
+ ng-model="value" placeholder="[% l('Note...') %]">
</textarea>
</div>
<div class="col-md-2">
diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index 052b9c9..6e1ed33 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -1804,9 +1804,16 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
egCore.org.settings([
'ui.staff.require_initials.copy_notes'
]).then(function(set) {
- $scope.require_initials = Boolean(set['ui.staff.require_initials.copy_notes']);
+ $scope.require_initials_ous = Boolean(set['ui.staff.require_initials.copy_notes']);
});
+ $scope.are_initials_required = function() {
+ $scope.require_initials = $scope.require_initials_ous && ($scope.note.value.length > 0 || $scope.note.title.length > 0);
+ };
+
+ $scope.$watch('note.value.length', $scope.are_initials_required);
+ $scope.$watch('note.title.length', $scope.are_initials_required);
+
$scope.note_list = [];
if (copy_list.length == 1) {
$scope.note_list = copy_list[0].notes();
@@ -1814,28 +1821,30 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
$scope.ok = function(note) {
- if ($scope.initials) {
- note.value = egCore.strings.$replace(
- egCore.strings.COPY_NOTE_INITIALS, {
- value : note.value,
- initials : $scope.initials,
- ws_ou : egCore.org.get(
- egCore.auth.user().ws_ou()).shortname()
+ if (note.value.length > 0 || note.title.length > 0) {
+ if ($scope.initials) {
+ note.value = egCore.strings.$replace(
+ egCore.strings.COPY_NOTE_INITIALS, {
+ value : note.value,
+ initials : $scope.initials,
+ ws_ou : egCore.org.get(
+ egCore.auth.user().ws_ou()).shortname()
+ });
+ }
+
+ angular.forEach(copy_list, function (cp) {
+ if (!angular.isArray(cp.notes())) cp.notes([]);
+ var n = new egCore.idl.acpn();
+ n.isnew(1);
+ n.creator(note.creator);
+ n.pub(note.pub);
+ n.title(note.title);
+ n.value(note.value);
+ n.owning_copy(cp.id());
+ cp.notes().push( n );
});
}
- angular.forEach(copy_list, function (cp) {
- if (!angular.isArray(cp.notes())) cp.notes([]);
- var n = new egCore.idl.acpn();
- n.isnew(1);
- n.creator(note.creator);
- n.pub(note.pub);
- n.title(note.title);
- n.value(note.value);
- n.owning_copy(cp.id());
- cp.notes().push( n );
- });
-
$uibModalInstance.close();
}
-----------------------------------------------------------------------
Summary of changes:
.../lib/OpenILS/Application/Cat/AssetCommon.pm | 2 +-
.../templates/staff/cat/volcopy/t_copy_notes.tt2 | 13 ++---
.../web/js/ui/default/staff/cat/volcopy/app.js | 49 ++++++++++++--------
3 files changed, 35 insertions(+), 29 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list