dialogBody="Delete Org Unit {{selected ? selected.label : ''}}?">
</eg-confirm-dialog>
+<ng-template #treeNodeLabelTmpl let-org="org">
+ <span *ngIf="org" i18n>{{org.name()}} ({{org.shortname()}})</span>
+</ng-template>
+<eg-string #treeNodeLabel key='admin.server.org_unit.treenode'
+ [template]="treeNodeLabelTmpl"></eg-string>
+
<div class="row">
<div class="col-lg-4">
<h3 i18n>Org Units</h3>
<eg-fm-record-editor idlClass="aoa" readonlyFields="org_unit"
[mode]="currentOrg().billing_address().isnew() ? 'create': 'update'"
[hideBanner]="true" displayMode="inline" hiddenFields="id"
- (recordSaved)="orgSaved($event ? $event.org_unit() : null)"
+ (recordSaved)="orgSaved()"
[recordId]="currentOrg().billing_address().isnew() ? null : currentOrg().billing_address().id()"
[record]="currentOrg().billing_address().isnew() ? currentOrg().billing_address() : null"
fieldOrder="address_type,street1,street2,city,county,state,country,post_code,san,valid"
</ng-template>
</ngb-tab>
<ngb-tab title="Holds Address" i18n-title id="holds">
+ <ng-template ngbTabContent>
+ <eg-fm-record-editor idlClass="aoa" readonlyFields="org_unit"
+ [mode]="currentOrg().holds_address().isnew() ? 'create': 'update'"
+ [hideBanner]="true" displayMode="inline" hiddenFields="id"
+ (recordSaved)="orgSaved()"
+ [recordId]="currentOrg().holds_address().isnew() ? null : currentOrg().holds_address().id()"
+ [record]="currentOrg().holds_address().isnew() ? currentOrg().holds_address() : null"
+ fieldOrder="address_type,street1,street2,city,county,state,country,post_code,san,valid"
+ >
+ </eg-fm-record-editor>
+ </ng-template>
</ngb-tab>
<ngb-tab title="Mailing Address" i18n-title id="mailing">
+ <ng-template ngbTabContent>
+ <eg-fm-record-editor idlClass="aoa" readonlyFields="org_unit"
+ [mode]="currentOrg().mailing_address().isnew() ? 'create': 'update'"
+ [hideBanner]="true" displayMode="inline" hiddenFields="id"
+ (recordSaved)="orgSaved()"
+ [recordId]="currentOrg().mailing_address().isnew() ? null : currentOrg().mailing_address().id()"
+ [record]="currentOrg().mailing_address().isnew() ? currentOrg().mailing_address() : null"
+ fieldOrder="address_type,street1,street2,city,county,state,country,post_code,san,valid"
+ >
+ </eg-fm-record-editor>
+ </ng-template>
</ngb-tab>
<ngb-tab title="ILL Address" i18n-title id="ill">
+ <ng-template ngbTabContent>
+ <eg-fm-record-editor idlClass="aoa" readonlyFields="org_unit"
+ [mode]="currentOrg().ill_address().isnew() ? 'create': 'update'"
+ [hideBanner]="true" displayMode="inline" hiddenFields="id"
+ (recordSaved)="orgSaved()"
+ [recordId]="currentOrg().ill_address().isnew() ? null : currentOrg().ill_address().id()"
+ [record]="currentOrg().ill_address().isnew() ? currentOrg().ill_address() : null"
+ fieldOrder="address_type,street1,street2,city,county,state,country,post_code,san,valid"
+ >
+ </eg-fm-record-editor>
+ </ng-template>
</ngb-tab>
</ngb-tabset>
</div>
import {PcrudService} from '@eg/core/pcrud.service';
import {ToastService} from '@eg/share/toast/toast.service';
import {StringComponent} from '@eg/share/string/string.component';
+import {StringService} from '@eg/share/string/string.service';
import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
private org: OrgService,
private auth: AuthService,
private pcrud: PcrudService,
+ private strings: StringService,
private toast: ToastService
) {}
}
orgSaved(orgId: number) {
+ if (!orgId && this.currentOrg()) {
+ orgId = this.currentOrg().id();
+ }
this.loadAouTree(orgId).then(_ => this.postUpdate(this.editString));
}
callerData: {orgUnit: orgNode}
});
+ // Apply the compiled label asynchronously
+ this.strings.interpolate(
+ 'admin.server.org_unit.treenode', {org: orgNode}
+ ).then(label => treeNode.label = label);
+
orgNode.children().forEach(childNode =>
treeNode.children.push(handleNode(childNode))
);