From: Bill Erickson Date: Tue, 16 Jun 2020 22:18:41 +0000 (-0400) Subject: LPXXX Angular Volcopy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9d867e4a5527e4ead31b3f07adb46631280b7284;p=working%2FEvergreen.git LPXXX Angular Volcopy Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html index 253b3bce08..c834bf82a1 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html @@ -1,9 +1,11 @@ +
-
+ +

Identification

Location

@@ -13,144 +15,92 @@
- - - - - - +
-
-
- - -
-
- - -
-
-
-
-
+
-
-
- +
+ + +
-
-
- - -
-
-
-
-
-
-
-
-
-
+
+ + +
- +
+ + +
-
-
- - -
-
-
-
-
-
-
-
-
-
+
+ + +
- +
+ + +
-
-
- - -
-
-
-
-
-
-
-
-
-
+
+ + +
- +
+ + +
-
-
- - -
-
-
-
-
-
+ +
-
-
- +
+ + + + -
-
- - -
-
-
-
-
-
-
-
-
-
+ + +
-
-
- - -
-
-
+
+ +
-
+
+ +
-
+ + +
-
+ + diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 9ef3b05820..5b8e12281e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -20,6 +20,8 @@ export class CopyAttrsComponent implements OnInit { @Input() context: VolCopyContext; + batchLocation: any; + constructor( private router: Router, private route: ActivatedRoute, @@ -53,6 +55,9 @@ export class CopyAttrsComponent implements OnInit { value = this.volcopy.copyStatuses[value].name(); } + } else if (field === 'location') { + value = value.name(); + } else if (field.match(/date/)) { value = this.format.transform({ datatype: 'timestamp', @@ -71,6 +76,19 @@ export class CopyAttrsComponent implements OnInit { return counts; } + + applyCopyValue(field: string, value: any) { + this.context.copyList().forEach(copy => { + if (copy[field] && copy[field]() !== value) { + copy[field](value); + copy.ischanged(true); + } + }); + } + + locationChanged() { + this.applyCopyValue('location', this.batchLocation); + } } diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.module.ts index 7a267feb5e..7400161776 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.module.ts @@ -7,6 +7,7 @@ import {VolCopyComponent} from './volcopy.component'; import {VolEditComponent} from './vol-edit.component'; import {VolCopyService} from './volcopy.service'; import {CopyAttrsComponent} from './copy-attrs.component'; +import {ItemLocationSelectModule} from '@eg/share/item-location-select/item-location-select.module'; @NgModule({ declarations: [ @@ -18,7 +19,8 @@ import {CopyAttrsComponent} from './copy-attrs.component'; StaffCommonModule, CommonWidgetsModule, HoldingsModule, - VolCopyRoutingModule + VolCopyRoutingModule, + ItemLocationSelectModule ], providers: [ VolCopyService diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts index 73d8654086..abaa8b8460 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts @@ -39,7 +39,12 @@ export class VolCopyService { defaults => { this.defaultValues = defaults || {}; } - ); + ).then(_ => { + + // Default to location ID 1 (Stacks) + return this.pcrud.retrieve('acpl', 1).toPromise() + .then(loc => this.defaultValues.location = loc); + }); } fetchCopyStats(): Promise { @@ -99,7 +104,7 @@ export class VolCopyService { copy.deposit_amount(0); copy.fine_level(2); // Normal copy.loan_duration(2); // Normal - copy.location(1); // Stacks + copy.location(this.defaultValues.location); // Stacks / fleshed copy.circulate('t'); copy.holdable('t'); copy.opac_visible('t');