LPXXX Angular Volcopy
authorBill Erickson <berickxx@gmail.com>
Mon, 22 Jun 2020 19:34:14 +0000 (15:34 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 22 Jun 2020 19:34:14 +0000 (15:34 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.html
Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.ts
Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html
Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html
Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts
Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html
Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts
Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts

index e69de29..419d477 100644 (file)
@@ -0,0 +1,503 @@
+<h3 i18n>Holdings Defaults</h3>
+
+<div class="row">
+  <div class="col-lg-6">
+    <div class="row">
+      <div class="col-lg-12">
+        <div class="card">
+          <div class="card-header" i18n>Holdings Display Defaults</div>
+          <ul class="list-group list-group-flush">
+            <li class="list-group-item">
+              <div class="form-check form-check-inline">
+                <input class="form-check-input" type="checkbox" 
+                  id="hide-classification-column" 
+                  [(ngModel)]="volcopy.defaultValues.hide_classification_column">
+                <label class="form-check-label" for="hide-classification-column" i18n>
+                  Hide Call Number Classification Column
+                </label>
+              </div>
+            </li>
+            <li class="list-group-item">
+              <div class="form-check form-check-inline">
+                <input class="form-check-input" type="checkbox" 
+                  id="hide-prefix-column" 
+                  [(ngModel)]="volcopy.defaultValues.hide_prefix_column">
+                <label class="form-check-label" for="hide-prefix-column" i18n>
+                  Hide Call Number Prefix Column
+                </label>
+              </div>
+            </li>
+            <li class="list-group-item">
+              <div class="form-check form-check-inline">
+                <input class="form-check-input" type="checkbox" 
+                  id="hide-suffix-column" 
+                  [(ngModel)]="volcopy.defaultValues.hide_suffix_column">
+                <label class="form-check-label" for="hide-suffix-column" i18n>
+                  Hide Call Number Suffix Column
+                </label>
+              </div>
+            </li>
+          </ul>
+        </div>
+      </div>
+    </div>
+  </div>
+  <div class="col-lg-6">
+    <div class="row">
+      <div class="col-lg-12">
+        <div class="card">
+          <div class="card-header" i18n>Holdings Creation Defaults</div>
+          <ul class="list-group list-group-flush p-2">
+            <li class="list-group-item">
+              <div class="row">
+                <div class="col-lg-4" i18n>
+                  <label for="default-classification" i18n>Default Classification</label>
+                </div>
+                <div class="col-lg-8">
+                  <eg-combobox
+                    domId="default-classification"
+                    [selectedId]="volcopy.defaultValues.classification || 1"
+                    [smallFormControl]="true"
+                    (onChange)="volcopy.defaultValues.classification = $entry ? $entry.id : null">
+                    <eg-combobox-entry *ngFor="let cls of volcopy.volClasses"
+                      [entryId]="cls.id()" [entryLabel]="cls.name()">
+                    </eg-combobox-entry>
+                  </eg-combobox>
+                </div>
+              </div>
+            </li>
+            <li class="list-group-item">
+              <div class="row">
+                <div class="col-lg-4" i18n>
+                  <label for="default-prefix" i18n>Default Prefix</label>
+                </div>
+                <div class="col-lg-8">
+                  <eg-combobox
+                    domId="default-prefix"
+                    [selectedId]="volcopy.defaultValues.prefix || -1"
+                    [smallFormControl]="true"
+                    (onChange)="volcopy.defaultValues.prefix = $entry ? $entry.id : null">
+                    <eg-combobox-entry 
+                      entryLabel="<None>" i18n-entryLabel [entryId]="-1">
+                    </eg-combobox-entry>
+                    <eg-combobox-entry *ngFor="let pfx of volcopy.volPrefixes"
+                      [entryId]="pfx.id()" [entryLabel]="pfx.label()">
+                    </eg-combobox-entry>
+                  </eg-combobox>
+                </div>
+              </div>
+            </li>
+            <li class="list-group-item">
+              <div class="row">
+                <div class="col-lg-4" i18n>
+                  <label for="default-suffix" i18n>Default Suffix</label>
+                </div>
+                <div class="col-lg-8">
+                  <eg-combobox
+                    domId="default-suffix"
+                    [selectedId]="volcopy.defaultValues.suffix || -1"
+                    [smallFormControl]="true"
+                    (onChange)="volcopy.defaultValues.suffix = $entry ? $entry.id : null">
+                    <eg-combobox-entry 
+                      entryLabel="<None>" i18n-entryLabel [entryId]="-1">
+                    </eg-combobox-entry>
+                    <eg-combobox-entry *ngFor="let sfx of volcopy.volSuffixes"
+                      [entryId]="sfx.id()" [entryLabel]="sfx.label()">
+                    </eg-combobox-entry>
+                  </eg-combobox>
+                </div>
+              </div>
+            </li>
+          </ul>
+        </div>
+      </div>
+    </div>
+  </div>
+</div>
+
+<hr class="p-2"/>
+
+<h3 i18n>Item Attributes Defaults</h3>
+<span class="font-italic" i18n>Selected Attributes Will Be Visible</span>
+
+<div class="row d-flex">
+
+  <!-- COLUMN 1 -->
+  <div class="flex-1 p-1">
+    <div class="card">
+      <div class="card-header" i18n>Identification</div>
+      <ul class="list-group list-group-flush">
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-status-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.status">
+            <label class="form-check-label" for="show-status-attr" i18n>
+              Status
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-barcode-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.barcode">
+            <label class="form-check-label" for="show-barcode-attr" i18n>
+              Barcode
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-create_date-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.create_date">
+            <label class="form-check-label" for="show-create_date-attr" i18n>
+              Creation Date
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-active_date-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.active_date">
+            <label class="form-check-label" for="show-active_date-attr" i18n>
+              Activation Date
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-creator-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.creator">
+            <label class="form-check-label" for="show-creator-attr" i18n>
+              Creator
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-edit_date-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.edit_date">
+            <label class="form-check-label" for="show-edit_date-attr" i18n>
+              Last Edit Date
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-editor-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.editor">
+            <label class="form-check-label" for="show-editor-attr" i18n>
+              Last Editor
+            </label>
+          </div>
+        </li>
+      </ul>
+    </div>
+  </div>
+
+  <!-- COLUMN 2 -->
+  <div class="flex-1 p-1">
+    <div class="card">
+      <div class="card-header" i18n>Location</div>
+      <ul class="list-group list-group-flush">
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-location-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.location">
+            <label class="form-check-label" for="show-location-attr" i18n>
+              Location
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-circ_lib-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.circ_lib">
+            <label class="form-check-label" for="show-circ_lib-attr" i18n>
+              Circulating Library
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-owning_lib-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.owning_lib">
+            <label class="form-check-label" for="show-owning_lib-attr" i18n>
+              Owning Library
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-copy_number-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.copy_number">
+            <label class="form-check-label" for="show-copy_number-attr" i18n>
+              Copy Number 
+            </label>
+          </div>
+        </li>
+      </ul>
+    </div>
+  </div>
+
+  <!-- COLUMN 3 -->
+
+  <div class="flex-1 p-1">
+    <div class="card">
+      <div class="card-header" i18n>Circulation</div>
+      <ul class="list-group list-group-flush">
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-circulate-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.circulate">
+            <label class="form-check-label" for="show-circulate-attr" i18n>
+              Circulate
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-holdable-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.holdable">
+            <label class="form-check-label" for="show-holdable-attr" i18n>
+              Holdable
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-age_protect-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.age_protect">
+            <label class="form-check-label" for="show-age_protect-attr" i18n>
+              Aged-Based Hold Protection
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-floating-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.floating">
+            <label class="form-check-label" for="show-floating-attr" i18n>
+              Floating
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-loan_duration-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.loan_duration">
+            <label class="form-check-label" for="show-loan_duration-attr" i18n>
+              Loan Duration
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-fine_level-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.fine_level">
+            <label class="form-check-label" for="show-fine_level-attr" i18n>
+              Fine Level
+            </label>
+          </div>
+        </li>
+        <li class="list-group-item">
+          <div class="form-check form-check-inline">
+            <input class="form-check-input" type="checkbox" 
+              id="show-circ_as_type-attr" 
+              [(ngModel)]="volcopy.defaultValues.attributes.circ_as_type">
+            <label class="form-check-label" for="show-circ_as_type-attr" i18n>
+              Circulate As Type
+            </label>
+          </div>
+        </li>
+      </ul>
+    </div>
+  </div>
+
+
+<!--
+
+
+
+    <div>
+      <ng-template #circModifierTemplate>
+        <select class="form-control" [(ngModel)]="values['circ_modifier']">
+          <option [value]="null" i18n>&lt;Unset&gt;</option>
+          <option *ngFor="let mod of circModifiers"
+            value="{{mod.code()}}">{{mod.name()}}</option>
+        </select>
+      </ng-template>
+      <eg-batch-item-attr label="Circulion Modifier" i18n-label
+        [emptyIsUnset]="true"
+        [editTemplate]="circModifierTemplate"
+        [labelCounts]="itemAttrCounts('circ_modifier')"
+        (changesSaved)="applyCopyValue('circ_modifier')">
+      </eg-batch-item-attr>
+    </div>
+
+  </div>
+
+
+  <div class="flex-1 p-1">
+    <div class="p-1"><h4 class="font-weight-bold" i18n>Miscellaneous</h4></div>
+
+
+    <div class="border rounded m-1">
+      <eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
+      <div class="batch-header font-weight-bold p-2" i18n>Add Item Alerts</div>
+      <div class="p-1">
+        <button class="btn btn-outline-dark" (click)="openCopyAlerts()" i18n>
+          Item Alerts
+        </button>
+      </div>
+    </div>
+
+    <div>
+      <ng-template #depositTemplate>
+        <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'deposit'}">
+        </ng-container>
+      </ng-template>
+      <eg-batch-item-attr label="Deposit" i18n-label
+        displayAs="bool"
+        editInputDomId="deposit-input"
+        [editTemplate]="depositTemplate"
+        [labelCounts]="itemAttrCounts('deposit')"
+        (changesSaved)="applyCopyValue('deposit')">
+      </eg-batch-item-attr>
+    </div>
+
+    <div>
+      <ng-template #depositAmountTemplate>
+        <input type="number" class="form-control" 
+          id="deposit-amount-input" [(ngModel)]="values['deposit_amount']"/>
+      </ng-template>
+      <eg-batch-item-attr label="Deposit Amount" i18n-label
+        displayAs="currency"
+        editInputDomId="deposit-amount-input"
+        [editTemplate]="depositAmountTemplate"
+        [labelCounts]="itemAttrCounts('deposit_amount')"
+        (changesSaved)="applyCopyValue('deposit_amount')">
+      </eg-batch-item-attr>
+    </div>
+
+    <div>
+      <ng-template #priceTemplate>
+        <input type="number" class="form-control" 
+          id="price-input" [(ngModel)]="values['price']"/>
+      </ng-template>
+      <eg-batch-item-attr label="Price" i18n-label
+        displayAs="currency"
+        editInputDomId="price-input"
+        [editTemplate]="priceTemplate"
+        [labelCounts]="itemAttrCounts('price')"
+        (changesSaved)="applyCopyValue('price')">
+      </eg-batch-item-attr>
+    </div>
+
+    <div>
+      <ng-template #opacVisibleTemplate>
+        <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'opac_visible'}">
+        </ng-container>
+      </ng-template>
+      <eg-batch-item-attr label="OPAC Visible" i18n-label
+        displayAs="bool"
+        editInputDomId="opac_visible-input"
+        [editTemplate]="opacVisibleTemplate"
+        [labelCounts]="itemAttrCounts('opac_visible')"
+        (changesSaved)="applyCopyValue('opac_visible')">
+      </eg-batch-item-attr>
+    </div>
+
+    <div>
+      <ng-template #refTemplate>
+        <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'ref'}">
+        </ng-container>
+      </ng-template>
+      <eg-batch-item-attr label="Reference" i18n-label
+        displayAs="bool"
+        editInputDomId="ref-input"
+        [editTemplate]="refTemplate"
+        [labelCounts]="itemAttrCounts('ref')"
+        (changesSaved)="applyCopyValue('ref')">
+      </eg-batch-item-attr>
+    </div>
+
+    <div>
+      <ng-template #costTemplate>
+        <input type="number" class="form-control" 
+          id="cost-input" [(ngModel)]="values['cost']"/>
+      </ng-template>
+      <eg-batch-item-attr label="Acquisition Cost" i18n-label
+        displayAs="currency"
+        editInputDomId="cost-input"
+        [emptyIsUnset]="true"
+        [editTemplate]="costTemplate"
+        [labelCounts]="itemAttrCounts('cost')"
+        (changesSaved)="applyCopyValue('cost')">
+      </eg-batch-item-attr>
+    </div>
+
+    <div>
+      <eg-string #mintConditionYes i18n-text text="Good"></eg-string>
+      <eg-string #mintConditionNo i18n-text text="Damaged"></eg-string>
+
+      <ng-template #mintConditionTemplate>
+        <select class="form-control" 
+          id="mint-condition-input" [(ngModel)]="values['mint_condition']">
+          <option value="t" i18n>{{mintConditionYes.text}}</option>
+          <option value="f" i18n>{{mintConditionNo.text}}</option>
+        </select>
+      </ng-template>
+      <eg-batch-item-attr label="Quality" i18n-label
+        editInputDomId="mint-condition-input"
+        [emptyIsUnset]="true"
+        [editTemplate]="mintConditionTemplate"
+        [labelCounts]="itemAttrCounts('mint_condition')"
+        (changesSaved)="applyCopyValue('mint_condition')">
+      </eg-batch-item-attr>
+    </div>
+
+  </div>
+
+  <div class="flex-1 p-1">
+    <div class="p-1"><h4 class="font-weight-bold" i18n>Statistics</h4></div>
+
+    <div *ngFor="let cat of statCats(); let idx = index">
+      <ng-template #statCatTemplate>
+        <eg-combobox domId="stat-cat-input-{{idx}}"
+          (ngModelChange)="statCatValues[cat.id()] = $event ? $event.id : null"
+          [ngModel]="statCatValues[cat.id()]">
+          <eg-combobox-entry *ngFor="let entry of cat.entries()"
+            [entryId]="entry.id()" [entryLabel]="entry.value()">
+          </eg-combobox-entry>
+        </eg-combobox>
+      </ng-template>
+      <eg-batch-item-attr label="{{cat.name()}} ({{orgSn(cat.owner())}})" i18n-label
+        editInputDomId="stat-cat-input-{{idx}}"
+        [emptyIsUnset]="true"
+        [editTemplate]="statCatTemplate"
+        [labelCounts]="statCatCounts(cat.id())"
+        (changesSaved)="statCatChanged(cat.id())">
+      </eg-batch-item-attr>
+    </div>
+    -->
+
+</div>
+
+
index 35c926b..b21f546 100644 (file)
@@ -34,12 +34,13 @@ export class VolCopyConfigComponent implements OnInit, AfterViewInit {
         private auth: AuthService,
         private pcrud: PcrudService,
         private holdings: HoldingsService,
-        private volcopy: VolCopyService,
         private format: FormatService,
-        private store: StoreService
+        private store: StoreService,
+        public  volcopy: VolCopyService
     ) { }
 
     ngOnInit() {
+        console.log('DEFAULTS', this.volcopy.defaultValues);
     }
 
     ngAfterViewInit() {
index 3086135..b99e852 100644 (file)
     </div>
 
     <div>
-      <ng-template #ageProtectTemplate>
-        <select class="form-control" [(ngModel)]="values['age_protect']">
-          <option [value]="null" i18n>&lt;Unset&gt;</option>
-          <option *ngFor="let rule of ageProtectRules" 
-            value="{{rule.id()}}">{{rule.name()}}</option>
-        </select>
-      </ng-template>
-      <eg-batch-item-attr label="Aged-Based Hold Protection" i18n-label
-        [emptyIsUnset]="true"
-        [editTemplate]="ageProtectTemplate"
-        [labelCounts]="itemAttrCounts('age_protect')"
-        (changesSaved)="applyCopyValue('age_protect')">
-      </eg-batch-item-attr>
-    </div>
-
-    <div>
       <ng-template #circAsTypeTemplate>
         <select class="form-control" [(ngModel)]="values['circ_as_type']">
           <option [value]="null" i18n>&lt;Unset&gt;</option>
index 9edeb21..8d06132 100644 (file)
 <div class="row d-flex bg-faint mb-2 pb-1 pt-1 border border-dark rounded">
   <div class="p-1" [ngStyle]="{flex: flexAt(1)}"> </div>
   <div class="p-1" [ngStyle]="{flex: flexAt(2)}"> </div>
-  <div class="p-1" [ngStyle]="{flex: flexAt(3)}">
+  <div class="p-1" [ngStyle]="{flex: flexAt(3)}" *ngIf="displayColumn('classification')">
     <div><label class="font-weight-bold" i18n>Classification</label></div>
     <div>
       <eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolClass">
-        <eg-combobox-entry *ngFor="let cls of volClasses"
+        <eg-combobox-entry *ngFor="let cls of volcopy.volClasses"
           [entryId]="cls.id()" [entryLabel]="cls.name()">
         </eg-combobox-entry>
       </eg-combobox>
     </div>
   </div>
-  <div class="p-1" [ngStyle]="{flex: flexAt(4)}">
+  <div class="p-1" [ngStyle]="{flex: flexAt(4)}" *ngIf="displayColumn('prefix')">
     <div><label class="font-weight-bold" i18n>Prefix</label></div>
     <div>
       <eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolPrefix">
-        <eg-combobox-entry *ngFor="let pfx of volPrefixes"
+        <eg-combobox-entry *ngFor="let pfx of volcopy.volPrefixes"
           [entryId]="pfx.id()" [entryLabel]="pfx.label()">
         </eg-combobox-entry>
       </eg-combobox>
       </eg-combobox>
     </div>
   </div>
-  <div class="p-1" [ngStyle]="{flex: flexAt(6)}">
+  <div class="p-1" [ngStyle]="{flex: flexAt(6)}" *ngIf="displayColumn('suffix')">
     <div><label class="font-weight-bold" i18n>Suffix</label></div>
     <div>
       <eg-combobox [smallFormControl]="true" [(ngModel)]="batchVolSuffix">
-        <eg-combobox-entry *ngFor="let sfx of volSuffixes"
+        <eg-combobox-entry *ngFor="let sfx of volcopy.volSuffixes"
           [entryId]="sfx.id()" [entryLabel]="sfx.label()">
         </eg-combobox-entry>
       </eg-combobox>
   <div class="p-1" [ngStyle]="{flex: flexAt(2)}">
     <label class="font-weight-bold" i18n>Call Numbers</label>
   </div>
-  <div class="p-1" [ngStyle]="{flex: flexAt(3)}">
+  <div class="p-1" [ngStyle]="{flex: flexAt(3)}" *ngIf="displayColumn('classification')">
     <label class="font-weight-bold" i18n>Classification</label>
   </div>
-  <div class="p-1" [ngStyle]="{flex: flexAt(4)}">
+  <div class="p-1" [ngStyle]="{flex: flexAt(4)}" *ngIf="displayColumn('prefix')">
     <label class="font-weight-bold" i18n>Prefix</label>
   </div>
   <div class="p-1" [ngStyle]="{flex: flexAt(5)}">
     <label class="font-weight-bold" i18n>Call Number Label</label>
   </div>
-  <div class="p-1" [ngStyle]="{flex: flexAt(6)}">
+  <div class="p-1" [ngStyle]="{flex: flexAt(6)}" *ngIf="displayColumn('suffix')">
     <label class="font-weight-bold" i18n>Suffix</label>
   </div>
   <div class="p-1" [ngStyle]="{flex: flexAt(7)}">
               (ngModelChange)="volCountChanged(orgNode, $event)"/>
           </ng-container>
         </div>
-        <div class="p-1" [ngStyle]="{flex: flexAt(3)}">
+        <div class="p-1" [ngStyle]="{flex: flexAt(3)}" *ngIf="displayColumn('classification')">
           <ng-container *ngIf="copyIdx == 0">
             <eg-combobox
               [selectedId]="volNode.target.label_class()"
               [smallFormControl]="true"
               [required]="true"
               (onChange)="applyVolValue(volNode.target, 'label_class', $event ? $event.id : null)">
-              <eg-combobox-entry *ngFor="let cls of volClasses"
+              <eg-combobox-entry *ngFor="let cls of volcopy.volClasses"
                 [entryId]="cls.id()" [entryLabel]="cls.name()">
               </eg-combobox-entry>
             </eg-combobox>
           </ng-container>
         </div>
-        <div class="p-1" [ngStyle]="{flex: flexAt(4)}">
+        <div class="p-1" [ngStyle]="{flex: flexAt(4)}" *ngIf="displayColumn('prefix')">
           <ng-container *ngIf="copyIdx == 0">
             <eg-combobox
               [selectedId]="volNode.target.prefix()"
               <eg-combobox-entry
                 [entryId]="-1" entryLabel="<None>" i18n-entryLabel>
               </eg-combobox-entry>
-              <eg-combobox-entry *ngFor="let pfx of volPrefixes"
+              <eg-combobox-entry *ngFor="let pfx of volcopy.volPrefixes"
                 [entryId]="pfx.id()" [entryLabel]="pfx.label()">
               </eg-combobox-entry>
             </eg-combobox>
               (change)="applyVolValue(volNode.target, 'label', $event.target.value)">
           </ng-container>
         </div>
-        <div class="p-1" [ngStyle]="{flex: flexAt(6)}">
+        <div class="p-1" [ngStyle]="{flex: flexAt(6)}" *ngIf="displayColumn('suffix')">
           <ng-container *ngIf="copyIdx == 0">
             <eg-combobox
               [selectedId]="volNode.target.suffix()"
               <eg-combobox-entry
                 [entryId]="-1" entryLabel="<None>" i18n-entryLabel>
               </eg-combobox-entry>
-              <eg-combobox-entry *ngFor="let sfx of volSuffixes"
+              <eg-combobox-entry *ngFor="let sfx of volcopy.volSuffixes"
                 [entryId]="sfx.id()" [entryLabel]="sfx.label()">
               </eg-combobox-entry>
             </eg-combobox>
index 4dc6574..c5007f2 100644 (file)
@@ -30,9 +30,6 @@ export class VolEditComponent implements OnInit {
     flexSettings: {[column: number]: number} = {
         1: 1, 2: 1, 3: 2, 4: 1, 5: 2, 6: 1, 7: 1, 8: 2, 9: 1, 10: 1};
 
-    volClasses: IdlObject[] = null;
-    volPrefixes: IdlObject[] = null;
-    volSuffixes: IdlObject[] = null;
     bibParts: {[bibId: number]: IdlObject[]} = {};
 
     batchVolClass: ComboboxEntry;
@@ -64,7 +61,7 @@ export class VolEditComponent implements OnInit {
         private net: NetService,
         private auth: AuthService,
         private holdings: HoldingsService,
-        private volcopy: VolCopyService
+        public  volcopy: VolCopyService
     ) {}
 
     ngOnInit() {
@@ -76,24 +73,6 @@ export class VolEditComponent implements OnInit {
         .then(labels => this.recordVolLabels = labels)
         .then(_ => this.fetchBibParts())
         .then(_ => this.addStubCopies());
-
-        this.holdings.fetchCallNumberClasses().then(
-            classes => this.volClasses = classes);
-
-        const myOrgs = this.org.fullPath(this.auth.user().ws_ou(), true);
-
-        // The batch edit controls only include values for "here"
-        this.holdings.fetchCallNumberPrefixes().then(prefixes =>
-            this.volPrefixes = prefixes
-                .filter(sfx => sfx.id() !== -1)
-                .filter(pfx => myOrgs.includes(pfx.owning_lib()))
-        );
-
-        this.holdings.fetchCallNumberSuffixes().then(suffixes =>
-            this.volSuffixes = suffixes
-                .filter(sfx => sfx.id() !== -1)
-                .filter(sfx => myOrgs.includes(sfx.owning_lib()))
-        );
     }
 
 
@@ -510,5 +489,10 @@ export class VolEditComponent implements OnInit {
             }
         }
     }
+
+    displayColumn(field: string): boolean {
+        const key = `hide_${field}_column`;
+        return this.volcopy.defaultValues[key] !== true;
+    }
 }
 
index 2c69778..996ebb7 100644 (file)
@@ -6,7 +6,7 @@
   </div>
 </div>
 
-<ng-container *ngIf="!sessionExpired">
+<ng-container *ngIf="!sessionExpired && !loading">
 
   <eg-bib-summary *ngIf="context.recordId" [recordId]="context.recordId"></eg-bib-summary>
 
index 8f15635..4d884f0 100644 (file)
@@ -114,6 +114,7 @@ export class VolCopyComponent implements OnInit {
         this.context.reset();
 
         this.volcopy.load()
+        .then(_ => console.log('VOLCOPYLOADED'))
         .then(_ => this.fetchHoldings(copyIds))
         .then(_ => this.volcopy.applyVolLabels(
             this.context.volNodes().map(n => n.target)))
index 07e009e..fad55a8 100644 (file)
@@ -32,6 +32,9 @@ export class VolCopyService {
     circModifiers: IdlObject[] = [];
     statCats: IdlObject[] = [];
     statCatEntryMap: {[id: number]: IdlObject} = {}; // entry id => entry
+    volClasses: IdlObject[] = null;
+    volPrefixes: IdlObject[] = null;
+    volSuffixes: IdlObject[] = null;
 
     templateNames: ComboboxEntry[] = [];
     templates: any = {};
@@ -52,14 +55,30 @@ export class VolCopyService {
     // Fetch the data that is always needed.
     load(): Promise<any> {
 
-        if (this.itemTypeMaps.length > 0) {
-            return Promise.resolve();
-        }
+        if (this.itemTypeMaps.length > 0) { return Promise.resolve(); }
+
+        const myOrgs = this.org.fullPath(this.auth.user().ws_ou(), true);
 
         return this.fetchDefaults()
         .then(_ => this.holdings.fetchCallNumberClasses())
-        .then(_ => this.holdings.fetchCallNumberPrefixes())
-        .then(_ => this.holdings.fetchCallNumberSuffixes())
+        .then(cls => this.volClasses = cls)
+
+        .then(_ => {
+            return this.holdings.fetchCallNumberPrefixes().then(prefixes =>
+                this.volPrefixes = prefixes
+                    .filter(sfx => sfx.id() !== -1)
+                    .filter(pfx => myOrgs.includes(pfx.owning_lib()))
+            );
+        })
+
+        .then(_ => {
+            return this.holdings.fetchCallNumberSuffixes().then(suffixes =>
+                this.volSuffixes = suffixes
+                    .filter(sfx => sfx.id() !== -1)
+                    .filter(sfx => myOrgs.includes(sfx.owning_lib()))
+            );
+        })
+
         .then(_ => this.fetchCopyStats())
         .then(_ => this.fetchTemplates())
         .then(_ => {