</class>
<class id="aoa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_address" oils_persist:tablename="actor.org_address" reporter:label="Org Address">
<fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
- <field name="address_type" reporter:datatype="text" oils_obj:required="true"/>
- <field name="city" reporter:datatype="text" oils_obj:required="true"/>
- <field name="country" reporter:datatype="text" oils_obj:required="true"/>
- <field name="county" reporter:datatype="text"/>
- <field name="id" reporter:datatype="id" />
- <field name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
- <field name="post_code" reporter:datatype="text" oils_obj:required="true"/>
- <field name="state" reporter:datatype="text"/>
- <field name="street1" reporter:datatype="text" oils_obj:required="true"/>
- <field name="street2" reporter:datatype="text"/>
- <field name="valid" reporter:datatype="bool" oils_obj:required="true"/>
- <field name="san" reporter:datatype="text" reporter:label="SAN"/>
+ <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
+ <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
+ <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
+ <field name="county" reporter:label="County" reporter:datatype="text"/>
+ <field name="id" reporter:label="ID" reporter:datatype="id" />
+ <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
+ <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
+ <field name="state" reporter:label="State" reporter:datatype="text"/>
+ <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
+ <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
+ <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
+ <field name="san" reporter:label="SAN" reporter:datatype="text"/>
</fields>
<links>
<link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
import {StringComponent} from '@eg/share/string/string.component';
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
-import {TranslateComponent} from '@eg/staff/share/translate/translate.component';
+import {TranslateComponent} from '@eg/share/translate/translate.component';
interface CustomFieldTemplate {
--- /dev/null
+import {NgModule} from '@angular/core';
+import {EgCommonModule} from '@eg/common.module';
+import {CommonWidgetsModule} from '@eg/share/common-widgets.module';
+import {StringModule} from '@eg/share/string/string.module';
+import {TranslateModule} from '@eg/share/translate/translate.module';
+import {FmRecordEditorComponent} from './fm-editor.component';
+
+
+@NgModule({
+ declarations: [
+ FmRecordEditorComponent
+ ],
+ imports: [
+ EgCommonModule,
+ StringModule,
+ TranslateModule,
+ CommonWidgetsModule
+ ],
+ exports: [
+ FmRecordEditorComponent
+ ],
+ providers: [
+ ]
+})
+
+export class FmRecordEditorModule { }
+
--- /dev/null
+import {NgModule} from '@angular/core';
+import {EgCommonModule} from '@eg/common.module';
+import {EgCoreModule} from '@eg/core/core.module';
+import {CommonWidgetsModule} from '@eg/share/common-widgets.module';
+import {OrgFamilySelectComponent} from './org-family-select.component';
+import {ReactiveFormsModule} from '@angular/forms';
+
+@NgModule({
+ declarations: [
+ OrgFamilySelectComponent
+ ],
+ imports: [
+ EgCommonModule,
+ EgCoreModule,
+ CommonWidgetsModule,
+ ReactiveFormsModule
+ ],
+ exports: [
+ OrgFamilySelectComponent
+ ],
+ providers: [
+ ]
+})
+
+export class OrgFamilySelectModule { }
+
--- /dev/null
+import {NgModule} from '@angular/core';
+import {EgCommonModule} from '@eg/common.module';
+import {EgCoreModule} from '@eg/core/core.module';
+import {StringComponent} from '@eg/share/string/string.component';
+import {StringService} from '@eg/share/string/string.service';
+
+
+@NgModule({
+ declarations: [
+ StringComponent
+ ],
+ imports: [
+ EgCommonModule,
+ EgCoreModule
+ ],
+ exports: [
+ StringComponent
+ ],
+ providers: [
+ StringService
+ ]
+})
+
+export class StringModule { }
+
--- /dev/null
+<ng-template #dialogContent>
+ <div class="modal-header bg-info">
+ <h4 class="modal-title" i18n>
+ {{idlClassDef.label}}
+ </h4>
+ <button type="button" class="close"
+ i18n-aria-label aria-label="Close" (click)="close()">
+ <span aria-hidden="true">×</span>
+ </button>
+ </div>
+ <div class="modal-body form-common form-validated" *ngIf="idlObj">
+ <div class="form-group row">
+ <label class="col-lg-4 text-right font-weight-bold"
+ i18n>Field Name</label>
+ <input
+ type="text"
+ [disabled]="true"
+ class="form-control col-lg-7"
+ value="{{idlClassDef.field_map[field].label}}">
+ </div>
+ <div class="form-group row">
+ <label class="col-lg-4 text-right font-weight-bold"
+ i18n>Current Value</label>
+ <input
+ type="text"
+ [disabled]="true"
+ class="form-control col-lg-7"
+ value="{{idlObj[field]()}}">
+ </div>
+ <div class="form-group row">
+ <label class="col-lg-4 text-right font-weight-bold"
+ i18n>Select Locale</label>
+ <select class="form-control col-lg-7"
+ (change)="localeChanged($event)"
+ [(ngModel)]="selectedLocale">
+ <option value="{{locale.code()}}" *ngFor="let locale of locales">
+ {{locale.name()}}
+ </option>
+ </select>
+ </div>
+ <div class="form-group row">
+ <label class="col-lg-4 text-right font-weight-bold" i18n>Translation</label>
+ <input
+ id='translation-input'
+ type="text"
+ class="form-control col-lg-7"
+ required
+ i18n-placeholder
+ (keyup.enter)="translate()"
+ placeholder="Translation..."
+ [(ngModel)]="translatedValue"/>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button *ngIf="prevString" (click)="prevString()"
+ class="btn btn-info" i18n>Prev String</button>
+ <button *ngIf="nextString" (click)="nextString()"
+ class="btn btn-info mr-3" i18n>Next String</button>
+ <button (click)="translate()" class="btn btn-info" i18n>Apply</button>
+ <button (click)="close()" class="btn btn-warning ml-2" i18n>Cancel</button>
+ </div>
+</ng-template>
--- /dev/null
+import {Component, OnInit, Input, Renderer2} from '@angular/core';
+import {IdlService, IdlObject} from '@eg/core/idl.service';
+import {ToastService} from '@eg/share/toast/toast.service';
+import {LocaleService} from '@eg/core/locale.service';
+import {AuthService} from '@eg/core/auth.service';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {DialogComponent} from '@eg/share/dialog/dialog.component';
+import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
+
+@Component({
+ selector: 'eg-translate',
+ templateUrl: 'translate.component.html'
+})
+
+export class TranslateComponent
+ extends DialogComponent implements OnInit {
+
+ idlClassDef: any;
+ locales: IdlObject[];
+ selectedLocale: string;
+ translatedValue: string;
+ existingTranslation: IdlObject;
+
+ // These actions should update the idlObject and/or fieldName values,
+ // forcing the dialog to load a new string to translate. When set,
+ // applying a translation in the dialog will leave the dialog window open
+ // so the next/prev buttons can be used to fetch the next string.
+ nextString: () => void;
+ prevString: () => void;
+
+ idlObj: IdlObject;
+ @Input() set idlObject(o: IdlObject) {
+ if (o) {
+ this.idlObj = o;
+ this.idlClassDef = this.idl.classes[o.classname];
+ this.fetchTranslation();
+ }
+ }
+
+ field: string;
+ @Input() set fieldName(n: string) {
+ this.field = n;
+ }
+
+ constructor(
+ private modal: NgbModal, // required for passing to parent
+ private renderer: Renderer2,
+ private idl: IdlService,
+ private toast: ToastService,
+ private locale: LocaleService,
+ private pcrud: PcrudService,
+ private auth: AuthService) {
+ super(modal);
+ }
+
+ ngOnInit() {
+ // Default to the login locale
+ this.selectedLocale = this.locale.currentLocaleCode();
+ this.locales = [];
+ this.locale.supportedLocales().subscribe(l => this.locales.push(l));
+
+ this.onOpen$.subscribe(() => {
+ const elm = this.renderer.selectRootElement('#translation-input');
+ if (elm) {
+ elm.focus();
+ elm.select();
+ }
+ });
+ }
+
+ localeChanged(code: string) {
+ this.fetchTranslation();
+ }
+
+ fetchTranslation() {
+ const exist = this.existingTranslation;
+
+ if (exist
+ && exist.fq_field() === this.fqField()
+ && exist.identity_value() === this.identValue()) {
+ // Already have the current translation object.
+ return;
+ }
+
+ this.translatedValue = '';
+ this.existingTranslation = null;
+
+ this.pcrud.search('i18n', {
+ translation: this.selectedLocale,
+ fq_field : this.fqField(),
+ identity_value: this.identValue()
+ }).subscribe(tr => {
+ this.existingTranslation = tr;
+ this.translatedValue = tr.string();
+ console.debug('found existing translation ', tr);
+ });
+ }
+
+ fqField(): string {
+ return this.idlClassDef.classname + '.' + this.field;
+ }
+
+ identValue(): string {
+ return this.idlObj[this.idlClassDef.pkey || 'id']();
+ }
+
+ translate() {
+ if (!this.translatedValue) { return; }
+
+ let entry;
+
+ if (this.existingTranslation) {
+ entry = this.existingTranslation;
+ entry.string(this.translatedValue);
+
+ this.pcrud.update(entry).toPromise().then(
+ ok => {
+ if (!this.nextString) {
+ this.close(this.translatedValue);
+ }
+ },
+ err => console.error(err)
+ );
+
+ return;
+ }
+
+ entry = this.idl.create('i18n');
+ entry.fq_field(this.fqField());
+ entry.identity_value(this.identValue());
+ entry.translation(this.selectedLocale);
+ entry.string(this.translatedValue);
+
+ this.pcrud.create(entry).toPromise().then(
+ ok => {
+ if (!this.nextString) {
+ this.close(this.translatedValue);
+ }
+ },
+ err => console.error('Translation creation failed')
+ );
+ }
+}
+
+
--- /dev/null
+import {NgModule} from '@angular/core';
+import {EgCommonModule} from '@eg/common.module';
+import {EgCoreModule} from '@eg/core/core.module';
+import {TranslateComponent} from './translate.component';
+
+
+@NgModule({
+ declarations: [
+ TranslateComponent
+ ],
+ imports: [
+ EgCommonModule,
+ EgCoreModule
+ ],
+ exports: [
+ TranslateComponent
+ ],
+ providers: [
+ ]
+})
+
+export class TranslateModule { }
+
import {NgModule} from '@angular/core';
import {StaffCommonModule} from '@eg/staff/common.module';
import {LinkTableComponent, LinkTableLinkComponent} from '@eg/staff/share/link-table/link-table.component';
+import {TranslateModule} from '@eg/share/translate/translate.module';
+import {FmRecordEditorModule} from '@eg/share/fm-editor/fm-editor.module';
+import {AdminPageModule} from '@eg/staff/share/admin-page/admin-page.module';
import {BasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component';
@NgModule({
BasicAdminPageComponent
],
imports: [
- StaffCommonModule
+ StaffCommonModule,
+ TranslateModule,
+ FmRecordEditorModule,
+ AdminPageModule
],
exports: [
StaffCommonModule,
+ TranslateModule,
+ FmRecordEditorModule,
+ AdminPageModule,
LinkTableComponent,
LinkTableLinkComponent,
BasicAdminPageComponent
import {NgModule} from '@angular/core';
+import {FmRecordEditorModule} from '@eg/share/fm-editor/fm-editor.module';
import {StaffCommonModule} from '@eg/staff/common.module';
import {CatalogCommonModule} from '@eg/share/catalog/catalog-common.module';
import {HttpClientModule} from '@angular/common/http';
import {TreeModule} from '@eg/share/tree/tree.module';
+import {AdminPageModule} from '@eg/staff/share/admin-page/admin-page.module';
import {VandelayRoutingModule} from './routing.module';
import {VandelayService} from './vandelay.service';
import {VandelayComponent} from './vandelay.component';
imports: [
TreeModule,
StaffCommonModule,
+ FmRecordEditorModule,
+ AdminPageModule,
CatalogCommonModule,
VandelayRoutingModule,
HttpClientModule,
import {NgModule} from '@angular/core';
+import {FmRecordEditorModule} from '@eg/share/fm-editor/fm-editor.module';
import {StaffCommonModule} from '@eg/staff/common.module';
import {CatalogCommonModule} from '@eg/share/catalog/catalog-common.module';
import {CatalogRoutingModule} from './routing.module';
],
imports: [
StaffCommonModule,
+ FmRecordEditorModule,
CatalogCommonModule,
CatalogRoutingModule,
HoldsModule,
import {AudioService} from '@eg/share/util/audio.service';
import {GridModule} from '@eg/share/grid/grid.module';
import {StaffBannerComponent} from './share/staff-banner.component';
-import {OrgFamilySelectComponent} from '@eg/share/org-family-select/org-family-select.component';
import {AccessKeyDirective} from '@eg/share/accesskey/accesskey.directive';
import {AccessKeyService} from '@eg/share/accesskey/accesskey.service';
import {AccessKeyInfoComponent} from '@eg/share/accesskey/accesskey-info.component';
import {OpChangeComponent} from '@eg/staff/share/op-change/op-change.component';
import {ToastService} from '@eg/share/toast/toast.service';
import {ToastComponent} from '@eg/share/toast/toast.component';
-import {StringComponent} from '@eg/share/string/string.component';
-import {StringService} from '@eg/share/string/string.service';
+import {StringModule} from '@eg/share/string/string.module';
import {TitleComponent} from '@eg/share/title/title.component';
-import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
import {BucketDialogComponent} from '@eg/staff/share/buckets/bucket-dialog.component';
import {BibSummaryComponent} from '@eg/staff/share/bib-summary/bib-summary.component';
-import {TranslateComponent} from '@eg/staff/share/translate/translate.component';
-import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.component';
import {EgHelpPopoverComponent} from '@eg/share/eg-help-popover/eg-help-popover.component';
import {ReactiveFormsModule} from '@angular/forms';
@NgModule({
declarations: [
StaffBannerComponent,
- OrgFamilySelectComponent,
AccessKeyDirective,
AccessKeyInfoComponent,
ToastComponent,
- StringComponent,
TitleComponent,
OpChangeComponent,
- FmRecordEditorComponent,
BucketDialogComponent,
BibSummaryComponent,
- TranslateComponent,
- AdminPageComponent,
EgHelpPopoverComponent
],
imports: [
EgCommonModule,
+ StringModule,
ReactiveFormsModule,
CommonWidgetsModule,
GridModule
CommonWidgetsModule,
GridModule,
StaffBannerComponent,
- OrgFamilySelectComponent,
AccessKeyDirective,
AccessKeyInfoComponent,
ToastComponent,
- StringComponent,
+ StringModule,
TitleComponent,
OpChangeComponent,
- FmRecordEditorComponent,
BucketDialogComponent,
BibSummaryComponent,
- TranslateComponent,
- AdminPageComponent,
EgHelpPopoverComponent
]
})
providers: [ // Export staff-wide services
AccessKeyService,
AudioService,
- StringService,
ToastService
]
};
import {NgModule} from '@angular/core';
+import {FmRecordEditorModule} from '@eg/share/fm-editor/fm-editor.module';
import {StaffCommonModule} from '@eg/staff/common.module';
+import {TranslateModule} from '@eg/share/translate/translate.module';
import {SandboxRoutingModule} from './routing.module';
import {SandboxComponent} from './sandbox.component';
import {ReactiveFormsModule} from '@angular/forms';
+import {OrgFamilySelectModule} from '@eg/share/org-family-select/org-family-select.module';
@NgModule({
declarations: [
],
imports: [
StaffCommonModule,
+ TranslateModule,
+ FmRecordEditorModule,
+ OrgFamilySelectModule,
SandboxRoutingModule,
ReactiveFormsModule
],
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {GridDataSource} from '@eg/share/grid/grid';
import {GridComponent} from '@eg/share/grid/grid.component';
-import {TranslateComponent} from '@eg/staff/share/translate/translate.component';
+import {TranslateComponent} from '@eg/share/translate/translate.component';
import {ToastService} from '@eg/share/toast/toast.service';
import {Pager} from '@eg/share/util/pager';
import {PcrudService} from '@eg/core/pcrud.service';
--- /dev/null
+import {NgModule} from '@angular/core';
+import {EgCommonModule} from '@eg/common.module';
+import {EgCoreModule} from '@eg/core/core.module';
+import {GridModule} from '@eg/share/grid/grid.module';
+import {StringModule} from '@eg/share/string/string.module';
+import {TranslateModule} from '@eg/share/translate/translate.module';
+import {FmRecordEditorModule} from '@eg/share/fm-editor/fm-editor.module';
+import {AdminPageComponent} from './admin-page.component';
+import {OrgFamilySelectModule} from '@eg/share/org-family-select/org-family-select.module';
+
+
+@NgModule({
+ declarations: [
+ AdminPageComponent
+ ],
+ imports: [
+ EgCommonModule,
+ EgCoreModule,
+ StringModule,
+ OrgFamilySelectModule,
+ TranslateModule,
+ FmRecordEditorModule,
+ GridModule
+ ],
+ exports: [
+ AdminPageComponent
+ ],
+ providers: [
+ ]
+})
+
+export class AdminPageModule { }
+
+++ /dev/null
-<ng-template #dialogContent>
- <div class="modal-header bg-info">
- <h4 class="modal-title" i18n>
- {{idlClassDef.label}}
- </h4>
- <button type="button" class="close"
- i18n-aria-label aria-label="Close" (click)="close()">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body form-common form-validated" *ngIf="idlObj">
- <div class="form-group row">
- <label class="col-lg-4 text-right font-weight-bold"
- i18n>Field Name</label>
- <input
- type="text"
- [disabled]="true"
- class="form-control col-lg-7"
- value="{{idlClassDef.field_map[field].label}}">
- </div>
- <div class="form-group row">
- <label class="col-lg-4 text-right font-weight-bold"
- i18n>Current Value</label>
- <input
- type="text"
- [disabled]="true"
- class="form-control col-lg-7"
- value="{{idlObj[field]()}}">
- </div>
- <div class="form-group row">
- <label class="col-lg-4 text-right font-weight-bold"
- i18n>Select Locale</label>
- <select class="form-control col-lg-7"
- (change)="localeChanged($event)"
- [(ngModel)]="selectedLocale">
- <option value="{{locale.code()}}" *ngFor="let locale of locales">
- {{locale.name()}}
- </option>
- </select>
- </div>
- <div class="form-group row">
- <label class="col-lg-4 text-right font-weight-bold" i18n>Translation</label>
- <input
- id='translation-input'
- type="text"
- class="form-control col-lg-7"
- required
- i18n-placeholder
- (keyup.enter)="translate()"
- placeholder="Translation..."
- [(ngModel)]="translatedValue"/>
- </div>
- </div>
- <div class="modal-footer">
- <button *ngIf="prevString" (click)="prevString()"
- class="btn btn-info" i18n>Prev String</button>
- <button *ngIf="nextString" (click)="nextString()"
- class="btn btn-info mr-3" i18n>Next String</button>
- <button (click)="translate()" class="btn btn-info" i18n>Apply</button>
- <button (click)="close()" class="btn btn-warning ml-2" i18n>Cancel</button>
- </div>
-</ng-template>
+++ /dev/null
-import {Component, OnInit, Input, Renderer2} from '@angular/core';
-import {IdlService, IdlObject} from '@eg/core/idl.service';
-import {ToastService} from '@eg/share/toast/toast.service';
-import {LocaleService} from '@eg/core/locale.service';
-import {AuthService} from '@eg/core/auth.service';
-import {PcrudService} from '@eg/core/pcrud.service';
-import {DialogComponent} from '@eg/share/dialog/dialog.component';
-import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'eg-translate',
- templateUrl: 'translate.component.html'
-})
-
-export class TranslateComponent
- extends DialogComponent implements OnInit {
-
- idlClassDef: any;
- locales: IdlObject[];
- selectedLocale: string;
- translatedValue: string;
- existingTranslation: IdlObject;
-
- // These actions should update the idlObject and/or fieldName values,
- // forcing the dialog to load a new string to translate. When set,
- // applying a translation in the dialog will leave the dialog window open
- // so the next/prev buttons can be used to fetch the next string.
- nextString: () => void;
- prevString: () => void;
-
- idlObj: IdlObject;
- @Input() set idlObject(o: IdlObject) {
- if (o) {
- this.idlObj = o;
- this.idlClassDef = this.idl.classes[o.classname];
- this.fetchTranslation();
- }
- }
-
- field: string;
- @Input() set fieldName(n: string) {
- this.field = n;
- }
-
- constructor(
- private modal: NgbModal, // required for passing to parent
- private renderer: Renderer2,
- private idl: IdlService,
- private toast: ToastService,
- private locale: LocaleService,
- private pcrud: PcrudService,
- private auth: AuthService) {
- super(modal);
- }
-
- ngOnInit() {
- // Default to the login locale
- this.selectedLocale = this.locale.currentLocaleCode();
- this.locales = [];
- this.locale.supportedLocales().subscribe(l => this.locales.push(l));
-
- this.onOpen$.subscribe(() => {
- const elm = this.renderer.selectRootElement('#translation-input');
- if (elm) {
- elm.focus();
- elm.select();
- }
- });
- }
-
- localeChanged(code: string) {
- this.fetchTranslation();
- }
-
- fetchTranslation() {
- const exist = this.existingTranslation;
-
- if (exist
- && exist.fq_field() === this.fqField()
- && exist.identity_value() === this.identValue()) {
- // Already have the current translation object.
- return;
- }
-
- this.translatedValue = '';
- this.existingTranslation = null;
-
- this.pcrud.search('i18n', {
- translation: this.selectedLocale,
- fq_field : this.fqField(),
- identity_value: this.identValue()
- }).subscribe(tr => {
- this.existingTranslation = tr;
- this.translatedValue = tr.string();
- console.debug('found existing translation ', tr);
- });
- }
-
- fqField(): string {
- return this.idlClassDef.classname + '.' + this.field;
- }
-
- identValue(): string {
- return this.idlObj[this.idlClassDef.pkey || 'id']();
- }
-
- translate() {
- if (!this.translatedValue) { return; }
-
- let entry;
-
- if (this.existingTranslation) {
- entry = this.existingTranslation;
- entry.string(this.translatedValue);
-
- this.pcrud.update(entry).toPromise().then(
- ok => {
- if (!this.nextString) {
- this.close(this.translatedValue);
- }
- },
- err => console.error(err)
- );
-
- return;
- }
-
- entry = this.idl.create('i18n');
- entry.fq_field(this.fqField());
- entry.identity_value(this.identValue());
- entry.translation(this.selectedLocale);
- entry.string(this.translatedValue);
-
- this.pcrud.create(entry).toPromise().then(
- ok => {
- if (!this.nextString) {
- this.close(this.translatedValue);
- }
- },
- err => console.error('Translation creation failed')
- );
- }
-}
-
-